Simple Breakpoint

by Aug 18, 2011

If you want PowerShell to halt your script at some point, you can simply add this line:

$host.EnterNestedPrompt()

This will suspend execution and you will get back to the prompt. You can now examine your script variables or even change them. To resume the script, you can then type exit.

Twitter This Tip!
ReTweet this Tip!