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

将-ea与Add-PSSnapin一起使用时,Powershell停止工作,powershell,powershell-4.0,Powershell,Powershell 4.0,我刚刚遇到了这种奇怪的行为: 以下行导致powershell停止工作: Add-PSSnapin Microsoft.Exchange.Management.PowerShell.E2010 -Erroraction Silentlycontinue 虽然以下方法很好: Add-PSSnapin Microsoft.Exchange.Management.PowerShell.E2010 这是在Eventviewer中发现的问题签名: P1:powershell.exe P2:6.3.960

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

以下行导致powershell停止工作:

Add-PSSnapin Microsoft.Exchange.Management.PowerShell.E2010 -Erroraction Silentlycontinue
虽然以下方法很好:

Add-PSSnapin Microsoft.Exchange.Management.PowerShell.E2010
这是在Eventviewer中发现的问题签名:

P1:powershell.exe

P2:6.3.9600.17090

P3:System.NullReferenceException

P4:System.TypeInitializationException

P5:未知

P6:oft.Exchange.Diagnostics.SystemTraceControl.Update

P7:未知

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


提前感谢

我在服务器2012 R2上遇到了这个问题。我能够利用-name参数使它工作

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

我无法告诉您为什么会发生这种情况,但我可以告诉您,Microsoft不支持使用添加了管理单元的通用PS会话来管理Exchange。@mjolinor谢谢,我知道,我很好,很遗憾我无法确认,因为我不再在发生这种情况的环境中工作,如果有人确认,我将很乐意接受您的回答