A quick note about exit codes from powershell

Jakob Nilsson-Ehle

This may be an extreme edge case, but since I spent a few hours on something rather trivial, I though I should share it. When running Invoke-Command from powershell invoked via command line – be wary of the curly braces. What is the difference between the following two commands? powershell.exe -Command “& {invoke-command {throw ‘error’}}” [...]

Tags: ,