I am currently trying out the Hybrid Search of SharePoint (2019) and am facing issues when trying to import 'Microsoft.Online.SharePoint.PowerShell'. I get the following message:
PS C:\Users\username> Import-Module Microsoft.Online.SharePoint.PowerShell -force
Import-Module : Could not load type 'Microsoft.SharePoint.Client.Publishing.PortalLaunch.PortalLaunchRedirectionType' from assembly 'Microsoft.SharePoint.Client.Publishing, Version=16.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c'. At line:1 char:1 Import-Module Microsoft.Online.SharePoint.PowerShell -force CategoryInfo : NotSpecified: (:) [Import-Module], TypeLoadException FullyQualifiedErrorId : System.TypeLoadException,Microsoft.PowerShell.Commands.ImportModuleCommand
Installing via Install-Module Microsoft.Online.SharePoint.PowerShell -force works without an error. Also, installing and importing other modules (e.g. Import-Module MSOnline -force or Import-Module MSOnlineExt -force) works fine.
When checking for the installed version I see the following:
PS C:\Users\username> Get-Module -Name Microsoft.Online.SharePoint.PowerShell -ListAvailable | Select Name,Version
Microsoft.Online.SharePoint.PowerShell 16.0.20616.12000
I have checked for any installed programs, but besides the SharePoint Server 2019 itself and the SharePoint Hybrid Configuration Wizard there is nothing else on that machine (in regards to SharePoint or other products like Exchange etc.).
I found a few forum posts and articles suggesting to manually remove Microsoft.SharePoint.Client folders from GAC which I think might not be the best choice in the end ;)
Any help is highly apprectiated.