powershell: [BUG] Cannot successfully use Register-PnPManagementShellAccess (per instructions)

Reporting an Issue or Missing Feature

Cannot successfully use Register-PnPManagementShellAccess per the instructions

Expected behavior

@ToddKlindt and I were trying out the process of moving from SharePointPnPPowerShellOnline to PnP.PowerShell. We know it’s still a bit early, but we like understanding new stuff. Once I got my machine set up with PowerShell 7 and had PnP.PowerShell installed, I tried Connect-PnPOnline, expecting it wouldn’t work on the first try, as shown in VS Code here.

image

Actual behavior

As shown in the screenshot above, I ran Register-PnPManagementShellAccess to set things up. The browser window popped up, I logged in, the browser window closed itself, and things just sat where they were in the image. Todd tested in a shell and had the same problem.

Instead, Todd tried closing the automatic browser window and manually going to http://microsoft.com/devicelogin in a browser tab. Logging in there took us to the consent dialog and Parker’s PnP Management Shell was installed in Enterprise Applications. image

Steps to reproduce behavior

Run Register-PnPManagementShellAccess and follow the prompts in the popup browser window.

What is the version of the Cmdlet module you are running?

0.3.14 nightly

Which operating system/environment are you running PnP PowerShell on?

  • Windows
  • Linux
  • MacOS
  • Azure Cloud Shell
  • Azure Functions
  • Other : please specify

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Reactions: 2
  • Comments: 25 (15 by maintainers)

Most upvoted comments

No, that’s not needed anymore. Thanks anway 😃

I actually made a change now where we do not automatically close the popup browser window when executing Register-PnPManagmentShellAccess. This will be available in the upcoming nightly release: 0.3.20-nightly.

Good to hear @ToddKlindt and I aren’t crazy. Let us know if we can help somehow. Sorry I hadn’t gotten to the Fiddler trace yet, but I can still do it if you need it.

I tested it with a colleague who was able to reproduce it. I’m looking into a solution now.