An external command is an executable program launched from PowerShell instead of a native PowerShell cmdlet or function. Existing utilities such as ping, nslookup, ifconfig, ipconfig, grep, bash, sed, and awk can run from the PowerShell prompt, with their results displayed as they would be in the older shell. This lets administrators keep using familiar tools while gradually adopting PowerShell commands. section 4.7
Use external commands when a familiar utility already solves the task:
- Run ping for connectivity checks, or use the native Test-Connection cmdlet when you need more options or more flexible output. section 4.7
- Remember that command discovery can return external applications as well as cmdlets; restrict Get-Command searches by command type, verb, or noun when you need only cmdlets. section 3.4
Invoke a command stored in a variable
A PowerShell variable can hold an executable name, while other variables hold its action and arguments: $exe = "func"; $action = "new"; $language = "powershell"; $template = "HttpTrigger"; $name = "myFunc"; & $exe $action -l $language -t $template -n $name. section 4.7
