-
Notifications
You must be signed in to change notification settings - Fork 392
Description
Notice
Many bugs reported are actually related to the PnP Framework which is used behind the scenes. Consider carefully where to report an issue:
Reporting an Issue or Missing Feature
I have recently forked the dev branch of PnP.PowerShell and was compiling the code in my machine. The code was compiling and I was able to debug the code as normal until Friday (21st July 2023). It works fine with Master branch
But since Yesterday, Whenever i try to run the code, I get a error as below,
WARNING: load.ps1: Import Modules -- Exception has been thrown by the target of an invocation.
(Screenshot as below)
I have tried to ignore this error and tried to connect to SPO and then i get this below error.
PS C:\Research\PnPPowershell\powershell> connect-PnPOnline -Url 'https://pm3q.sharepoint.com/sites/SampleTeamSite' -Interactive
connect-PnPOnline: The 'connect-PnPOnline' command was found in the module 'PnP.PowerShell', but the module could not be loaded due to the following error: [Assembly with same name is already loaded]
For more information, run 'Import-Module PnP.PowerShell'.
PS C:\Research\PnPPowershell\powershell>
(Screenshot as below)
I tried to connect to SPO outside of the repository, it doesnt give me this error.
(Screenshot as below)
Suggestion
If i try compiling Master branch, It works as a charm.
I guess this error is from src\Commands\_debug\debug.ps1 & src\Commands\Base\PnPPowerShellModuleInitializer.cs. (Just skeptical, Please correct me if i am wrong). Kindly suggest.
Expected behavior
Should be able to compile the code and debug
What is the version of the Cmdlet module you are running?
(you can retrieve this by executing Get-Module -Name "PnP.PowerShell" -ListAvailable)
Which operating system/environment are you running PnP PowerShell on?
- Windows
- Linux
- MacOS
- Azure Cloud Shell
- Azure Functions
- Other : please specify
Thanks,
Nishkalank Bezawada






