Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why won't PowerShell ISE let me set breakpoints when running as Administrator?

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?

like image 363
Kev Avatar asked Dec 06 '10 16:12

Kev


People also ask

How do you add a breakpoint in PowerShell ISE?

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.

How do I run PowerShell ISE as administrator?

With Administrative privileges (Run as administrator)Click Start, type ISE, right-click Windows PowerShell ISE, and then click Run as administrator.

What allows to set breakpoints?

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.

How do I run PowerShell in Debug mode?

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.


1 Answers

I also faced the same issue, Saving the file to a physical location enabled all debugging capabilities.

like image 111
Vinay Avatar answered Sep 18 '22 19:09

Vinay