July 17th, 2015

PowerTip: Set PowerShell Breakpoint Based on Variable

Doctor Scripto
Scripter

Summary: Set a Windows PowerShell breakpoint based on a variable.

Hey, Scripting Guy! Question How can I enter the Windows PowerShell debugger when a particular variable is accessed in a specific
           Windows PowerShell script?

Hey, Scripting Guy! Answer Set a breakpoint and specify a particular variable and script, for example:

Set-PSBreakpoint -Variable num -Mode write -Script C:\FSO\BadScript.ps1

Author

The "Scripting Guys" is a historical title passed from scripter to scripter. The current revision has morphed into our good friend Doctor Scripto who has been with us since the very beginning.

0 comments

Discussion are closed.

Feedback