我正在尝试运行此脚本:
$dll = Add-Type -Path \\machineX\Folder\\AL.Scripting.dll
New-Object AL.Scripting.BsmScriptObject
在 PS 5.1 上运行时一切正常,但在 PW 7 上运行时,我得到:
System.AggregateException: One or more errors occurred.
(Error importing Scripting Object DLL.Exception calling ".ctor" with "0" argument(s):
"Method not found: 'Void System.AppDomainSetup.set_ApplicationBase(System.String)'.")
我试图通过 .NET Core API 访问此 PW 命令结果,但这似乎是不可能的,因为 .NET Core 解决方案只能使用 PowerShell 6.0-7.0 版本。也许有任何解决方法吗?