且构网

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

从C#在PowerShell 6中运行PowerShell脚本

更新时间:2021-07-16 03:53:18

从技术上讲,这并不能解决问题,但是我做到了 @MindSwipe 建议并完全用C#重写代码.这并不是一件容易的事,但最终还是一个不错的解决方案.

This doesn't technically solve the problem, but I did as @MindSwipe suggested and rewrote the code in C# entirely. It wasn't trivially easy but it's a nice and elegant solution in the end.

如果您有关于如何正确解决此问题的想法,请在此处发布,因为我仍然对如何从C#调用PowerShell 6上的内容感兴趣.

If you have an idea on how to solve this question properly, please post it here as I'm still interested in how to call stuff on PowerShell 6 from C#.