invoke-command -computer hq128804 -scriptblock {powershell.exe -nonprofile -executionpolicy Bypass c:\Install-WMF5.ps1}
The Error:
Missing expression after unary operator '-'.
+ CategoryInfo : NotSpecified: (Missing express...y operator '-'.:String) [], RemoteException
+ FullyQualifiedErrorId : NativeCommandError
+ PSComputerName : hq128804
At line:1 char:2
+ - <<<< nonprofile -executionpolicy Bypass c:\Install-WMF5.ps1
+ CategoryInfo : ParserError: (-:String) [], ParentContainsErrorR
ecordException
+ FullyQualifiedErrorId : MissingExpressionAfterOperator
NotSpecified: (:) [], RemoteException
I am trying to run a script that is located on the root file system of another remote PC. I want to be able to execute this and update PowerShell for 2000 machines. I have the update files on each system, I just need a way to execute the .ps1 file Microsoft provides from my machine.
Install-WMF5.ps1) has an error - your code example seems good.nonprofile -> NoProfile