Forum Discussion
Andy_Bond
Mar 03, 2019Copper Contributor
Can't import SharePoint online Powershell module
when I use Import-Module Microsoft.Online.SharePoint.PowerShell it says PS C:\Windows\system32> Import-Module Microsoft.Online.SharePoint.PowerShell Import-Module : Could not load type 'Microsoft...
Kirk Munro
Apr 22, 2020Copper Contributor
Glenn Goffin I don't think direct manipulation of dlls in the GAC is the right solution here. This issue is actually caused by a conflict with SharePoint Online Components SDK. Recent versions of the Microsoft.Online.SharePoint.PowerShell module simply will not load as long as that is installed on a system. If you uninstall SharePoint Online Components, the module will load just fine.
DeTron
Aug 13, 2020Copper Contributor
Kirk Munro although I strongly agree with your cautious approach to this, I wanted to note that my various attempts to uninstall the SharePoint Online Components (e.g. initial uninstall = no luck. re-install and uninstall using elevated command prompt = no luck) never did the trick. Using Glenn Goffin 's GAC "nuclear option" was what finally did the trick for me.
I assume the SOC components came in from my Visual Studio 2019 install since I don't know how else they got installed, btw. But for now, adios SOC/COSM dlls.
So, Kirk, your warnings may be especially important for those (unlike me) who are doing ShPt dev work.
Respectfully, D.