且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何在C#中对PowerShell Core二进制cmdlet进行单元测试

更新时间: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.