PsExec is used to run commands remotely on a machine.
I was trying to execute a PowerShell file remote using PsExec but the command would just hang.
Below is the command:
PsExec.exe \\MachineName powershell -File "FileName.ps1"
The fix was to run the command in an interactive mode by passing -i agrument to PsExec.
Here it is:
PsExec.exe -i \\MachineName powershell -File "FileName.ps1"
Sweet, the command ran fine this time!
I was trying to execute a PowerShell file remote using PsExec but the command would just hang.
Below is the command:
PsExec.exe \\MachineName powershell -File "FileName.ps1"
The fix was to run the command in an interactive mode by passing -i agrument to PsExec.
Here it is:
PsExec.exe -i \\MachineName powershell -File "FileName.ps1"
Sweet, the command ran fine this time!
Thanks for that, That's exactly what I was experiencing - problem solved
ReplyDeleteYou legend!
ReplyDeleteI love you! Thank you for this!
ReplyDelete