

If in the main body, it continues to the end or the next breakpoint. Steps out of the current function up one level, if nested. The skipped statements are executed, but not stepped through. The commands appear in the table that follows (this table is copied from my Microsoft Press book, Windows PowerShell 2.0 Best Practices book).Įxecutes the next statement and then stops.Įxecutes the next statement, but skips functions and invocations.

This special mode permits the use of certain commands. When the script pauses execution, the Windows PowerShell console drops into debug mode. Today, I want to spend a little time looking at some of the things to do with one of the cmdlets.ĭebugging a Windows PowerShell script often involves setting a breakpoint, which is something that causes the Windows PowerShell script to pause execution. In Windows PowerShell 2.0, we introduced several Windows PowerShell cmdlets that make it easier to debug scripts. Every once in a while, however, the problem is not obvious, and being able to actually debug the script comes in helpful.
SCRIPT DEBUGGER MICROSOFT HOW TO
I generally write code in such a way that when a problem occurs, it is obvious where the problem lies and how to correct it. Never have, even back in the VBScript days. To be honest, I rarely fire up a debugger. Invariably, when I am talking to people about writing Windows PowerShell scripts, someone comes up with the question about script debugging. But the best thing is getting to work with customers and talking to people about Windows PowerShell. When they say things like, “It snowed yesterday,” I grimace a little and reluctantly tell them it was 70 degrees Fahrenheit (21 degrees Celsius according to my unit conversion module) in sunny Southern California. One of the fun things about traveling, especially to warm places when it is winter back home, is calling to talk to friends and relatives. Summary: Learn how to use the Windows PowerShell script debugger to troubleshoot problems with scripts.
