Wednesday, July 13, 2016

Capturing output from external commands in PowerShell

Great article on running external commands from PowerShell:

http://edgylogic.com/blog/powershell-and-external-commands-done-right/

Especially useful - information on capturing output from external commands in PowerShell:

for example:

& schtasks /END /TN $TaskName | Tee-Object -Variable scriptOutput | Out-Null Write-Host $scriptOutput

No comments:

Post a Comment