I ran a debugger on a script via Windows PowerShell ISE with breakpoints.
After this, when running from PowerShell.exe (not ISE), the script hangs.
I created a minidump (using ProcExplorer) and analyzed (using windbg.exe).
Analysis shows that it is stopped at a breakpoint!
However, I have no breakpoints set in my powershell session, nor do any show up if I re-open the script in ISE.
I’ve tried restarting the server, aggressively clearing breakpoints via PS-breakpoint commands, and even deleting the file and then re-creating it from a copy I’d pasted into notepad++.
Any thoughts or advise? This seems like an ISE internals thing, or something in the way PowerShell stores breakpoints.
EXCEPTION_RECORD: (.exr -1)
ExceptionAddress: 0000000000000000
ExceptionCode: 80000003 (Break instruction exception)
ExceptionFlags: 00000000
NumberParameters: 0
FAULTING_THREAD: 00002e2c
PROCESS_NAME: powershell.exe
ERROR_CODE: (NTSTATUS) 0x80000003 - {EXCEPTION} Breakpoint A breakpoint has been reached.
EXCEPTION_CODE_STR: 80000003
The actual command it seems to be hanging on is this:
$Matches = $DMLFileContents | Select-String ("INSERT.*?INTO.*?DATAFIX_METADATA.*?;") -AllMatches | % { $_.Matches } | % { $_.Value }