我想從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");
上述不起作用。有人可以告訴我如何做到這一點?
什麼,準確地說,「不工作」你的現有代碼? –