Debugger
noun
say it: “dee-BUG-er” /diˈbʌɡər/
A tool that runs a program with a pause button, so you can stop it, go one line at a time and see the values it's using.
What is a debugger in PowerShell?
A debugger runs a script with a pause button. It stops at breakpoints, runs one line at a time (F10 in VS Code, v at the [DBG]: prompt), and shows every variable's value right then, so you can find the line where a value isn't what you expected.
# Paused at the breakpoint on line 9; the prompt starts with [DBG]:
Test-Path $Destination # True: the folder is there
Test-Path $to # False: this receipt isn't
# v runs one line, c carries on, q stops the script
In a sentence
- “The debugger showed that line 9 was asking about the folder, not the receipt.”
- “Sam used VS Code's debugger to step through the mover one line at a time.”
Level: Apprentice · More PowerShell terms at this level
Updated