August 20, 2012

External program execution handling in Powershell

External command handling in Powershell is quite similar to .cmd-files. For example:
svn update
if ($lastexitcode -ne 0) { throw $lastexitcode }

UPD: it is better to use throw in powershell rather than exit