Tip: Explore New Cmdlets for Debugging in Windows PowerShell 2.0

Follow Our Daily Tips

Twitter | Blog | RSS | Facebook

The new debugging features in Windows PowerShell 2.0 make the Set-PSDebug cmdlet seem rudimentary or even cumbersome. When you become more familiar with the new debugging features, you might decide to never use Set-PSDebug again.

Several new cmdlets were created to enable debugging from both the Windows PowerShell console and from the Windows PowerShell Integrated Scripting Environment (ISE). Here is an overview of the new debugging cmdlets:
Set-PSBreakpoint Sets breakpoints on lines, variables, and commands.
Get-PSBreakpoint Gets breakpoints in the current session.
Disable-PSBreakpoint Turns off breakpoints in the current session.
Enable-PSBreakpoint Re-enables breakpoints in the current session.
Remove-PSBreakpoint Deletes breakpoints from the current session.
Get-PSCallStack Displays the current call stack.

From the Microsoft Press book Windows PowerShell 2.0 Best Practices by Ed Wilson with the Windows PowerShell Teams at Microsoft.

Looking for More Tips?

For more tips on using Microsoft products and technologies, visit the TechNet Magazine Tips library.