1
我需要一個接一個地運行兩個powershell命令,我應該創建一個管道兩次還是有更好的選擇?由於C#將命令傳入PowerShell
Runspace myRunSpace = RunspaceFactory.CreateRunspace(rc);
myRunSpace.Open();
Pipeline pipeLine = myRunSpace.CreatePipeline();
using (pipeLine)
{
Command myCommand = new Command("Get-Command...");
}
Pipeline pipeLine2 = myRunSpace.CreatePipeline();
using (pipeLine2)
{
Command myCommand = new Command("Get-Command...");
}
這有什麼區別?謝謝 – 2009-07-05 23:10:20