【发布时间】:2010-11-08 06:16:50
【问题描述】:
我需要一个接一个地运行两个 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...");
}
【问题讨论】:
标签: c# powershell