我想从C#类传递参数给Powershell脚本。我正在使用Process.Start
运行脚本。从C#传递和访问Powershell参数#
string powerShellLocation = @"C:\WINDOWS\system32\windowspowershell\v1.0\powershell.exe";
ProcessStartInfo psi = new ProcessStartInfo(powerShellLocation);
psi.Arguments = String.Format("{0} {1}", scriptPath, "some_parameter");
上述不起作用。有人可以告诉我如何做到这一点?
什么,准确地说,“不工作”你的现有代码? –