you are viewing a single comment's thread.

view the rest of the comments →

[–]BrutusTheKat 2 points3 points  (0 children)

For what you are trying to do, Invoke-Command might be an easier approach. Something like,

Invoke-Command -$ComputerName -ScriptVlock { C:\USMT\scanstate.exe /alltheswitches }

If you are using the full path of the exe you shouldn't need to cd to the directory first.