I have a PowerShell script that ran fine on my old computer (Windows 10, VSCode, Powershell 7). After changing hardware, moving to Windows 11, and re-installing, the script is not working.
I am calling Import-Module Adaxes at the top of the script. I have tried using the following line (because I'm prior to Adaxes 2025) and also without.
[Reflection.Assembly]::LoadWithPartialName("Softerra.Adaxes.Adsi")
The error:
When I call:
$ns = New-Object "Softerra.Adaxes.Adsi.AdmNamespace"
I get the following error:
118 | $ns = New-Object "Softerra.Adaxes.Adsi.AdmNamespace"
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| Exception calling ".ctor" with "0" argument(s): "Could not load type 'System.Runtime.Remoting.Channels.IChannel' from assembly 'mscorlib, Version=4.0.0.0, Culture=neutral,
| PublicKeyToken=b77a5c561934e089'."
.NET 4.8 is installed.
Any ideas on how to resolve this error?