Problems launching browser as admin

When I run PowerShell 7.4.3 as admin, there are issues when a browser should be launched but doesn’t behave appropriately. For example:

  1. When I get help and select a related link for online information, a familiar Windows popup asks which app to use. I select Edge and click to use Always. The next time I click a link, I’m asked again to select the app. I’ve tried with edge and Chrome, and neither stick.
  2. When I run Connect-MgGraph -Scopes “User.Read.All”, “Group.ReadWrite.All” which requires web authentication, a browser never launches. The terminal hangs, and I have to Ctrl-C out of it. Other similar commands that require web authentication fail the same way, i.e., no browser is launched.
  3. When I run Connect-MgGraph -Scopes “User.Read.All”, “Group.ReadWrite.All” -UseDeviceAuthentication I get a link to open a page for the code, similar to #1 above. I get the same Windows popup, select Edge, and continue. There are other steps, but the connection is made. The next time I use the command, I’m asked again to select the app, etc.

I’ve tried this with the same results in multiple Windows Powershell apps and VS Code PowerShell Extension. All have problems with Powershell 7, but not Powershell 5. I don’t have the same problems as a standard user.

I’d very much appreciate some pointers on this. I’m a long-time hacker but still relatively new to Powershell.

You repeated this on another system? I don’t think what you are experiencing is a problem with PowerShell, sounds more or less like a problem with your system or profile. What makes you think this issue has something to do with PowerShell?

FWIW - All that stuff works fine normally, and the fact that you’re having it happen in different contexts tells me something outside of PS is borked. Try on a new windows profile or new system entirely.

1 Like

This appears to have been resolved by authorizing Microsoft Graph Command Line Tools under MS 365 Entra Enterprise Applications. Why everything worked previously for standard user accounts but not for admins is still a mystery.