Turn Ps script debugging features on and off, and set trace level.
Snap-In: Microsoft.PowerShell.Core
Syntax:
Set-PSDebug
[-Trace <Int32>] [-Step] [-Strict] [-Verbose] [-Debug] [-ErrorAction <ActionPreference>] [-ErrorVariable <String>] [-OutVariable <String>] [-OutBuffer <Int32>]
Set-PSDebug
[-Off] [-Verbose] [-Debug] [-ErrorAction <ActionPreference>] [-ErrorVariable <String>] [-OutVariable <String>] [-OutBuffer <Int32>]
Description:
This command allows you to control the script debugging options in the Ps interpreter. When -trace is set to 1, only the line of script to be executed will be emitted. When -trace is set to 2, variable assignments, functions, and script calls will also be traced. If -step is set, the user is presented with the same choices as the -Confirm parameter before each line of the script is executed. The behavior of the system in response to the confirmation prompt in step mode is as follows:
"Yes" executes the single line
"Yes to All" exits step mode (the script continues to run with no confirmation prompts)"No" and "No To All" exit the script
"Suspend" launches a nested shell and then returns to the confirmation prompt w hen the nested shell exits.