如何在所有平台中的C#中运行PowerShell命令
我想在简单的控制台应用程序上运行Power Shell命令。
我正在运行x64
平台。
当我使用Anycpu
选项运行时,它不起作用。
我得到错误pnputil:术语“ pnputil”一词不被识别为cmdlet的名称,
如果我使用x64
选项运行,则该名称正在工作。
我如何运行该应用程序,以便它可以在平台上使用(例如x32,x64)
而无需手动指定?
谢谢你。
edit :
我可以用 this 。但不要因为它不安全。
I want to run power shell command on a simple console app.
I'm running on x64
platform.
As I'm running with AnyCpu
option it's not working.
I'm getting error pnputil : The term 'pnputil' is not recognized as the name of a cmdlet,
If i'm running with x64
option it's working.
How can I run the application so it'll work on platforms(e.g on x32 , x64)
Without specifying manually?
Thank You.
Edit:
I can solve it with something like this. but don't want as it's not safe.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论