Using Advanced Breakpoints

by Jul 4, 2012

PowerShell supports dynamic breakpoints. They trigger when certain requirements are met. Like regular breakpoints, they all require that your script has been saved to a file.

This line will set a breakpoint for script c:\test\script.ps1 that always triggers when the script accesses the variable $Server, read or write:

Set-PSBreakpoint -Script 'c:\test\script.ps1' -Variable Server -Mode ReadWrite

Check out the other examples in PowerShell’s help:

Get-Help -Name Set-PSBreakpoint -Examples

Twitter This Tip! ReTweet this Tip!