Calling Other Programs

Programs such as git, dotnet and npm run from PowerShell by name, hand back their output as lines of text, take arguments from variables and arrays, and run by a path with & in front; a failing program doesn't stop a script by itself, so check $LASTEXITCODE after it, or set $PSNativeCommandUseErrorActionPreference to $true.

Updated

Cheat sheet for the lesson Calling Other Programs: Programs such as git, dotnet and npm run from PowerShell by name, hand back their output as lines of text, take arguments from variables and arrays, and run by a path with & in front; a failing program doesn't stop a script by itself, so check…
Category
PowerShell
Level
Journeyman
Tags
call-operator, exit-code, native-command, powershell, psnativecommanduseerroractionpreference, splatting