The error came because I had Powershell version 5.xx, but you need 7.xx.
I was able to fix the error by completely reinstalling Powershell in the 7 version.
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
I want to connect to PnP.PowerShell, but when I execute this command:
Connect-PnPOnline -Url <> -Interactive
I obtain this error:
Connect-PnPOnline : The 'Connect-PnPOnline' command was found in the module 'PnP.PowerShell', but the module could not be loaded. For more information, run 'Import-Module PnP.PowerShell'.
When I run:
Import-Module PnP.PowerShell
I obtain this error:
Import modules: The file or assembly "System.Management.Automation, Version=7.2.0.0, Culture=neutral,
PublicKeyToken=31bf3856ad364e35" or a dependency on it was not found. The system cannot find the specified file
File.
Can anybody help me?
The error came because I had Powershell version 5.xx, but you need 7.xx.
I was able to fix the error by completely reinstalling Powershell in the 7 version.
Hello
Thank you for your question and reaching out.
Make sure the 'PnP.PowerShell' module is set up. In an elevated PowerShell session, enter the following command to install it if you haven't already:
Install-Module -Name PnP.PowerShell
Try manually importing the module using the 'Import-Module' command if it has already been installed:
Import-Module PnP.PowerShell
--If the reply is helpful, please Upvote and Accept as answer--