Powershell bug where external commands silently fail Powershell bug where external commands silently fail powershell powershell

Powershell bug where external commands silently fail


Unfortunately I don't have an answer for you, but I have also seen this exact behavior and I can add some insight; I know for a fact that I am not using write-host, and this problem only occurs when I use powershell V2's background jobs and remoting together. Typically this happens after I've run a fairly large number of background jobs, and just like you the problem is isolated to that single powershell process. Relaunching powershell always fixes the problem.


For anyone else that may run into this - check all lines that have write-host - in my case the culprit was this line in the script:

Write-Host **************************************

It was used at the end as a visual marker that all loops have completed and below it there was a summary... As soon as I remove it, the commands execute. If I add it, they stop executing... Maybe the asterisks overflow some buffer? Not sure but I will never use them again... :)


If you are using /R option with the robocopy command then try increasing the number of retries. Better use the default value.Hope this works fine.

-Archit