PowerShell - get process ID of called application PowerShell - get process ID of called application powershell powershell

PowerShell - get process ID of called application


Use Start-Process with the -PassThru argument like this:

$app = Start-Process notepad -passthruWait-Process $app.Id


More succinct:

# Starts Notepad and returns the ID(Start-Process Notepad -passthru).ID