We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fd0cb1e commit 279f32eCopy full SHA for 279f32e
debugger.ps1
@@ -0,0 +1,24 @@
1
+Param(
2
+ [string]$script,
3
+ [array]$bps
4
+ )
5
+
6
+$scriptToDebug = $script
7
8
+$breakpointAction = {
9
+ Write-Host "Breakpoint hit at line: $($PSItem.Line)"
10
+ Write-Host "Script: $($PSItem.Script)"
11
+ Write-Host "Stack Trace Details:"
12
+ Get-PSCallStack | ForEach-Object {
13
+ Write-Host $_
14
+ }
15
+}
16
17
+foreach ($breakpointLine in $bps)
18
+{
19
+ Set-PSBreakpoint -Script $scriptToDebug -Line $breakpointLine -Action $breakpointAction
20
21
22
+& $scriptToDebug
23
24
+Get-PSBreakpoint | Remove-PSBreakpoint
0 commit comments