更新时间:2023-11-08 22:19:28
我遇到了同样的问题.我可以通过将 Microsoft.PowerShell.SDK 安装到我的计算机中来解决此问题单元测试项目,随后我的Cmdlet.Invoke()
和Powershell.Create()
调用开始正确运行.
I experienced this same problem. I was able to resolve this by installing Microsoft.PowerShell.SDK into my unit test project, whereupon my Cmdlet.Invoke()
and Powershell.Create()
calls began working correctly.