Powershell 在将 -ea 与 Add-PSSnapin 一起使用时停止工作



我刚刚遇到了这种奇怪的行为:

以下行导致电源外壳停止工作:

Add-PSSnapin Microsoft.Exchange.Management.PowerShell.E2010 -Erroraction Silentlycontinue

虽然以下内容工作正常:

Add-PSSnapin Microsoft.Exchange.Management.PowerShell.E2010

这是在事件查看器中找到的问题签名:

P1:电源外壳.exe

P2: 6.3.9600.17090

P3: System.NullReferenceException

P4: 系统类型初始化异常

P5:未知

P6:经常。Exchange.Diagnostics.SystemTraceControl.Update

P7:未知

有谁知道为什么会这样?系统在服务器 2012R2 上运行

提前致谢

我在Server 2012 R2上遇到了这个确切的问题。我能够通过利用 -name 参数让它工作。

Add-PSSnapin -name "Microsoft.Exchange.Management.PowerShell.E2010"

最新更新