December 28th, 2012

PowerTip: Easily Pause a PowerShell Script for a Process to End

Doctor Scripto
Scripter

Summary: Learn how to pause a Windows PowerShell script and wait for another process to end prior to continuing.

Hey, Scripting Guy! Question How can you easily pause a Windows PowerShell script and wait for a specific process to end prior to continuing execution?

Hey, Scripting Guy! AnswerUse the Wait-Process cmdlet. It will wait for either a process name, a process ID, or even a specified time-out interval, as shown here.

Wait-Process -Name notepad

 

Author

The "Scripting Guys" is a historical title passed from scripter to scripter. The current revision has morphed into our good friend Doctor Scripto who has been with us since the very beginning.

0 comments

Discussion are closed.

Feedback