PowerTip: Cause PowerShell to Wait for Specific Event

Doctor Scripto

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


Discussion is closed.

Feedback usabilla icon