$app = Start-Process notepad -passthru Wait-Process $app.Id
# Starts Notepad and returns the ID (Start-Process Notepad -passthru).ID