Stop


Definition: Suspends execution.

 

If you have the Microsoft Scripting Debugger installed you can insert Stop statements that temporarily suspend the script each and every time they are encountered. Windows PowerShell does not have a similar feature (in part because it does not have a script debugger). However, you canrun Windows PowerShell in step-by-step mode, which is roughly akin to putting a Stop statement after each and every line of code.  That can be done by using the Set- PSDebugCmdlet and using the –stepparameter:

 

set- psdebug –step

 

To exit the step-by-step mode simply usethis command:

 

set- psdebug -off