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.