[英]Powershell stops working when using -ea with Add-PSSnapin
i just encountered this strange behaviour: 我刚遇到这种奇怪的行为:
The following line causes powershell to stop working: 以下行导致powershell停止工作:
Add-PSSnapin Microsoft.Exchange.Management.PowerShell.E2010 -Erroraction Silentlycontinue
while the following works fine: 虽然以下工作正常:
Add-PSSnapin Microsoft.Exchange.Management.PowerShell.E2010
This is the problem signature found in the Eventviewer: 这是在Eventviewer中找到的问题签名:
P1: powershell.exe
P1:powershell.exe
P2: 6.3.9600.17090
P2:6.3.900.17090
P3: System.NullReferenceException
P3:System.NullReferenceException
P4: System.TypeInitializationException
P4:System.TypeInitializationException
P5: unknown
P5:未知
P6: oft.Exchange.Diagnostics.SystemTraceControl.Update
P6:oft.Exchange.Diagnostics.SystemTraceControl.Update
P7: unknown
P7:未知
Does anyone have a clue why this happens? 有谁知道为什么会这样吗? The system runs on Server 2012R2
系统在Server 2012R2上运行
Thanks in advance 提前致谢
I had this exact issue on Server 2012 R2. 我在Server 2012 R2上遇到了这个确切的问题。 I was able to get it working by leveraging the -name argument.
我可以通过使用-name参数来使其工作。
Add-PSSnapin -name "Microsoft.Exchange.Management.PowerShell.E2010"
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.