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’.
If you are struggling with this error like i did for some time i found the easiest fix for it is to remove the 2.1.1 version and keep the 1.12.0 version of PnP.PowerShell. Hoping the Issue will be solved in PnP 2.1.1 or newer releases but until then I can’t Upgrade yet.
How to remove this version:
Run CMD as Administrator
Type PowerShell and hit Enter
then run the command
Uninstall-Module
-Name
PnP.PowerShell
-AllVersions
-Force
to install the earlier version use the following command
Install-Module PnP.PowerShell -RequiredVersion 1.12.0 -Force