Quantcast
Viewing all articles
Browse latest Browse all 36188

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

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

Image may be NSFW.
Clik here to view.
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?

Image may be NSFW.
Clik here to view.
Hey, Scripting Guy! Answer
Use 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

 

Image may be NSFW.
Clik here to view.

Image may be NSFW.
Clik here to view.

Viewing all articles
Browse latest Browse all 36188

Trending Articles