Skip to content

[BUG] Get-PnPGraphAccessToken does not work after updating to PNP 3.x #4925

@mikelee1313

Description

@mikelee1313

Reporting an Issue or Missing Feature

After updating to PNP 3.1.0, Get-PnPGraphAccessToken stopped working.

Expected behavior

Get-PnPGraphAccessToken should use an updated assembly and work with PNP 3.1.0 and higher.

Actual behavior

Running Get-PnPGraphAccessToken throws errror:

Get-PnPGraphAccessToken: The 'Get-PnPGraphAccessToken' command was found in the module 'PnP.PowerShell', but the module could not be loaded due to the following error: [Could not load file or assembly 'PnP.PowerShell, Version=2.12.0.0, Culture=neutral, PublicKeyToken=null'. Assembly with same name is already loaded]
For more information, run 'Import-Module PnP.PowerShell'.

Steps to reproduce behavior

  1. Install PNP 3.1.0
  2. Run Get-PnPGraphAccessToken

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

ModuleType Version PreRelease Name PSEdition ExportedCommands


Manifest 3.1.0 PnP.PowerShell Core {Add-PnPAdaptiveScopeProperty, Add-PnPEntraIDGroupMember, Add-PnPEntraIDGroupOwner, Add-PnPEntraIDServicePrincipalAppRole…}
Manifest 2.12.0 PnP.PowerShell Core {Add-PnPAdaptiveScopeProperty, Add-PnPEntraIDGroupMember, Add-PnPEntraIDGroupOwner, Add-PnPEntraIDServicePrincipalAppRole…}
Manifest 2.4.46 nightly PnP.PowerShell Desk {Add-PnPAdaptiveScopeProperty, Add-PnPEntraIDGroupMember, Add-PnPEntraIDGroupOwner, Add-PnPEntraIDServicePrincipalAppRole…}

Directory: C:\Users\michlee\OneDrive - Microsoft\Documents\WindowsPowerShell\Modules

ModuleType Version PreRelease Name PSEdition ExportedCommands


Manifest 2.2.3 nightly PnP.PowerShell Desk {Add-PnPAdaptiveScopeProperty, Add-PnPPropertyBagValue, Add-PnPSiteClassification, Copy-PnPFolder…}

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

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions