Quantcast
Channel: Windows PowerShell forum
Viewing all articles
Browse latest Browse all 21975

Save output of a command

$
0
0

Hi all,

I am trying to save the output of a command so I can read it and decide weather it completed successfully or not.  I am having trouble running the command though. It's working but the switches aren't.

$Servers = Get-Content Servers.txt | Sort-Object
ForEach ( $Server in $Servers ) { & PsExec.exe \\$Server 'C:\Program Files (x86)\progfolder\program.exe' option -t=$Duration -e=$email -c=$Comment -q=110
}

When ran it complains I am not specifying any options/switches. Ideas?
Thanks.


Viewing all articles
Browse latest Browse all 21975

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>