Wednesday, February 25, 2015

Using PSEXEC to execute powershell scripts remotely

I ran into an issue where I found myself having to hit the any key to complete a psexec call to a batch file that launches powershell. The workaround was to add -inputformat none to my launch parameters for powershell.

example: powershell -inputformat none -file C:\scripts\StampBackups.ps1 -executionpolicy bypass 

ref http://stackoverflow.com/questions/4238192/running-powershell-from-msdeploy-runcommand-does-not-exit/4239192#4239192

ref https://connect.microsoft.com/PowerShell/feedback/details/572313/powershell-exe-can-hang-if-stdin-is-redirected

1 comment: