PowerTip: Cause PowerShell to Wait for Specific Event

The Scripting Guys

Dr

Summary: Cause Windows PowerShell to wait for a specific event to be generated.

Hey, Scripting Guy! Question How can I make my Windows PowerShell console halt until an event that I registered by using the 
           Register-CimIndicationEvent cmdlet occurs?

Hey, Scripting Guy! Answer Use the Wait-Event cmdlet and specifiy the source identifier. For example, if you registered
           for an event named nq, use the following command:

Wait-Event -SourceIdentifier nq

The Scripting Guys
Dr Scripto

Follow Dr   

No Comments.