Created
July 25, 2021 12:36
-
-
Save sassdawe/5ca66461d86484c556de1537c99b0ebd to your computer and use it in GitHub Desktop.
Debug in PowerShell with rolling log file
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Function Debug-PowerShell() { | |
[CmdletBinding()] | |
[Alias("dbps")] | |
param ( | |
[string]$Path = "$ENV:TEMP\psdebu.log" | |
) | |
$Global:DebugLog = $Path | |
New-Item $Global:DebugLog -Force -ItemType File | |
Start-Process powershell -ArgumentList "-noprofile","-command &{Get-Content '$DebugLog' -Wait}" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment