The 'Connect-PnPOnline' command was found in the module 'PnP.PowerShell', but the module could not be loaded #2967
-
We did not have this error by using 1.12.0 pnp module but now we get it with 2.1.1 since 2023-04-01. We always Import-Module then connect to SharePoint Online for file automation tasks. Error for "Connect-PnPOnline": The 'Connect-PnPOnline' command was found in the module 'PnP.PowerShell', but the OS: Windows Server 2012 R2
When we try to fix the issue by manually checking the code by line, we get error when running Import-Module as well. Error for "Import-Module": Could not load file or assembly 'System.Management.Automation, Version=7.2.0.0, Culture=neutral, |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hi there lidacbl. I had this issue earlier after updating PS through ISE to v2.1.1 Also same error for Import-Module. Take a look here: #2969 Release 2.1.1 has dropped support for PS 5.1 and ISE Options are: You could also consider rolling back to version 1.12.0: Uninstall-Module -Name "PnP.PowerShell" -Force Hope that helps. |
Beta Was this translation helpful? Give feedback.
Hi there lidacbl. I had this issue earlier after updating PS through ISE to v2.1.1 Also same error for Import-Module.
Take a look here: #2969
Release 2.1.1 has dropped support for PS 5.1 and ISE
Options are:
install PS 7.2 or later.
You could also consider rolling back to version 1.12.0:
Uninstall-Module -Name "PnP.PowerShell" -Force
Install-Module PnP.PowerShell -RequiredVersion 1.12.0 -Force
Hope that helps.