I get this error when I run Import-Module -Name ActiveDirectory on Powershell 7:
WARNING: Module ActiveDirectory is loaded in Windows PowerShell using WinPSCompatSession remoting session; please note that all input and output of commands from this module will be deserialized objects. If you want to load this module into PowerShell please use 'Import-Module -SkipEditionCheck' syntax.
The suggested -SkipEditionCheck parameter also does not work:
Import-Module: Could not load type 'System.Management.Automation.PSSnapIn' from assembly 'System.Management.Automation, Version=184.108.40.206, Culture=neutral, PublicKeyToken=xxxxxxxxxxxxxx'.
My ps1 script does not work with deserialized objects. A hint from https://github.com/PowerShell/PowerShell/issues/12907 suggests that I need the module from Windows Server 2019.
Is there a way to upgrade the ActiveDirectory module without upgrading Windows Server? Or is there a way to import the module "correctly" into Powershell 7?