コード例 #1
0
ファイル: PSRemotingCmdlet.cs プロジェクト: 40a/PowerShell
        protected void CreateHelpersForSpecifiedRunspaces()
        {
            RemoteRunspace[] remoteRunspaces;
            Pipeline[] pipelines;

            // extract RemoteRunspace out of the PSSession objects
            int length = Session.Length;
            remoteRunspaces = new RemoteRunspace[length];

            for (int i = 0; i < length; i++)
            {
                remoteRunspaces[i] = (RemoteRunspace)Session[i].Runspace;
            }

            // create the set of pipelines from the RemoteRunspace objects and 
            // create IREHelperRunspace helper class to create operations
            pipelines = new Pipeline[length];

            for (int i = 0; i < length; i++)
            {
                pipelines[i] = CreatePipeline(remoteRunspaces[i]);

                // create the operation object
                IThrottleOperation operation = new ExecutionCmdletHelperRunspace(pipelines[i]);
                Operations.Add(operation);
            }
        } // CreateHelpersForSpecifiedRunspaces
コード例 #2
0
ファイル: PSExecutionCmdlet.cs プロジェクト: nickchal/pash
 protected void CreateHelpersForSpecifiedRunspaces()
 {
     int length = this.Session.Length;
     RemoteRunspace[] runspaceArray = new RemoteRunspace[length];
     for (int i = 0; i < length; i++)
     {
         runspaceArray[i] = (RemoteRunspace) this.Session[i].Runspace;
     }
     Pipeline[] pipelineArray = new Pipeline[length];
     for (int j = 0; j < length; j++)
     {
         pipelineArray[j] = this.CreatePipeline(runspaceArray[j]);
         IThrottleOperation item = new ExecutionCmdletHelperRunspace(pipelineArray[j]);
         this.Operations.Add(item);
     }
 }