通过 Process.Start 将多个参数传递给 powershell 文件

问题描述

我在为 powershell 文件传递​​多个参数以通过 Process.Start 运行时遇到问题。这是我目前所拥有的

                    strCmdText = "/c powershell.exe -file " + filePath + " " + configs[i].name + " " + configs[i].path + "/" + configs[i].extension + " " + configs[i].value;
                System.Diagnostics.Process pro = System.Diagnostics.Process.Start("cmd.exe",strCmdText);

我找到了许多示例来演示如何通过它执行 powershell 文件,但从来没有任何一个具有多个参数的示例,我认为它会是这样的,但命令无法正常工作。

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)