Converting VBScript's Stop Statement

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 can run 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-PSDebug Cmdlet and using the -step parameter:

set-psdebug -step

To exit the step-by-step mode simply use this command:

set-psdebug -off

Return to the VBScript to Windows PowerShell home page