Having failed to get PowerGUI to work properly I've fallen back on PowerShell ISE. However if I run this as Administrator it won't let me set any breakpoints.
If I launch as normal (my login is a member of Administrators) all is well but because I need to script some tasks that require full administrator rights this is no good.
I have saved the script as a proper file (i.e. it's not "untitled1.ps1") but no joy.
I'm running Windows 7 x64 Ultimate.
Strangely this doesn't seem to be a problem on my Windows 2008 R2 dev box (I'm logging in as user that is a member of Administrators then running PS ISE "As Administrator" and breakpoints are set and hit.
Any ideas why this would be?
To enable a specific breakpoint, right-click the line where you want to enable a breakpoint, and then click Enable Breakpoint. Or, click the line where you want to enable a breakpoint, and then press F9 or, on the Debug menu, click Enable Breakpoint.
With Administrative privileges (Run as administrator)Click Start, type ISE, right-click Windows PowerShell ISE, and then click Run as administrator.
Set breakpoints in source code To set a breakpoint in source code: Click in the far left margin next to a line of code. You can also select the line and press F9, select Debug > Toggle Breakpoint, or right-click and select Breakpoint > Insert breakpoint. The breakpoint appears as a red dot in the left margin.
Press F5 or, on the toolbar, click the Run Script icon, or on the Debug menu, click Run/Continue or, in the Console Pane, type C and then press ENTER . This causes the script to continue running to the next breakpoint or to the end of the script if no further breakpoints are encountered.
I also faced the same issue, Saving the file to a physical location enabled all debugging capabilities.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With