【问题标题】:Powershell stops working when using -ea with Add-PSSnapin将 -ea 与 Add-PSSnapin 一起使用时,Powershell 停止工作
【发布时间】:2016-04-10 03:32:37
【问题描述】:

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

以下行导致 powershell 停止工作:

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

虽然以下工作正常:

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

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

P1:powershell.exe

P2:6.3.9600.17090

P3:System.NullReferenceException

P4:System.TypeInitializationException

P5:未知

P6:oft.Exchange.Diagnostics.SystemTraceControl.Update

P7:未知

有人知道为什么会这样吗?系统运行于Server 2012R2

提前致谢

【问题讨论】:

  • 我无法告诉您为什么会发生这种情况,但我可以告诉您,Microsoft 不支持使用添加了该管理单元的通用 PS 会话来管理 Exchange。
  • @mjolinor 谢谢我知道,我很好

标签: powershell powershell-4.0


【解决方案1】:

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

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

【讨论】:

  • 很遗憾我无法确认,因为我不再在发生这种情况的环境中工作,如果有人确认,我很乐意接受您的回答
猜你喜欢
  • 1970-01-01
  • 2015-07-15
  • 1970-01-01
  • 2018-12-13
  • 2018-11-20
  • 2016-07-12
  • 1970-01-01
  • 1970-01-01
  • 2012-12-12
相关资源
最近更新 更多