Set-PSDebug -Trace 1
- 0: Turn script tracing off.
- 1: Trace script lines as they run.
- 2: Trace script lines, variable
assignments, function calls, and scripts.
For more info: https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/set-psdebug?view=powershell-6