Running New-OnPremiseHybridWorker in PowerShell 7 fails with the following error:
Exception: C:\Users\theboss\Documents\PowerShell\Scripts\New-OnPremiseHybridWorker.ps1:385 Line | 385 | throw "The HybridRegistration module was not found. Please ensure … | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | The HybridRegistration module was not found. Please ensure the Microsoft Monitoring Agent was | correctly installed.
The failure seems to be on
Import-Module .\HybridRegistration.psd1
...which returns
Import-Module: Could not load type 'System.Web.HttpException' from assembly 'System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'.
This works in PowerShell 5.1, but I'm not able to run the full script in 5.1 because I need to retain the AzureRM module. I don't want to downgrade to PowerShell 6...
Running New-OnPremiseHybridWorker in PowerShell 7 fails with the following error:
Exception: C:\Users\theboss\Documents\PowerShell\Scripts\New-OnPremiseHybridWorker.ps1:385 Line | 385 | throw "The HybridRegistration module was not found. Please ensure … | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | The HybridRegistration module was not found. Please ensure the Microsoft Monitoring Agent was | correctly installed.
The failure seems to be on
Import-Module .\HybridRegistration.psd1
...which returnsImport-Module: Could not load type 'System.Web.HttpException' from assembly 'System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'.
This works in PowerShell 5.1, but I'm not able to run the full script in 5.1 because I need to retain the AzureRM module. I don't want to downgrade to PowerShell 6...