1
下面的代碼在嘗試結束調用時拋出PipelineStoppedException。有人可以看到任何錯誤嗎?謝謝。powershell爲異步調用拋出PipelineStoppedException
using (PowerShell powershell = PowerShell.Create())
{
powershell.AddScript(script);
powershell.Runspace = CreateRunspace();
lock (powershell.Runspace)
{
powershell.BeginInvoke(
input,
setting,
delegate(IAsyncResult result)
{
powershell.EndInvoke(result); // throw pipeline stopped exception.
},
null);
}
}
感謝您的回覆。 – jiangok 2010-12-29 17:40:01