PowerShell V3 breakpoint bug
- Written by Alexander Riedel
- Last Updated: 19 April 2016
- Created: 24 September 2012
- Hits: 5303
While we are adapting and verifying all our bits and pieces for PowerShell V3 and Windows 8, we stumbled across little changes from PowerShell V2 behavior. Most of the time they were pretty simple and we adapted our code to a new object or a change of where the information is located.
Sometimes however we came across a real bug. This was one of these instances. The following has been tested in Windows 8 RTM with the PowerShell V3 ISE (64 Bit).
Take the following simple script:
We will put a breakpoint on line 2 and hit run:
Now we put a breakpoint on line 4 and hit run
PowerShell V3 ignores the additional breakpoint and just runs to the end.
In V2 the engine stops at breakpoints applied after the start of a script while V3 simply ignores all breakpoints set after starting the script.
Using the corresponding set-psbreakpoint in the console window has the same — none that is.
So, if you are using Powershell V3, get used to setting breakpoints as required before starting a script.