PowerShell – get process ID of called application

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

$app = Start-Process notepad -passthru
Wait-Process $app.Id

Leave a Comment