Revision: 28529
Updated Code
at July 9, 2010 04:16 by markshoe
Updated Code
string cmdArg = ".\script.ps1 -foo bar" � � � � � � Collection<PSObject> psresults; using (Pipeline pipeline = _runspace.CreatePipeline()) � � � � � � { � � � � � � � � pipeline.Commands.AddScript(cmdArg); � � � � � � � � pipeline.Commands[0].MergeMyResults(PipelineResultTypes.Error, PipelineResultTypes.Output); � � � � � � � � psresults = pipeline.Invoke(); � � � � � � } return psresults;
Revision: 28528
Updated Code
at July 9, 2010 04:15 by markshoe
Updated Code
string cmdArg = ".\script.ps1 -foo bar"       Collection<PSObject> psresults; using (Pipeline pipeline = _runspace.CreatePipeline())       {         pipeline.Commands.AddScript(cmdArg);         pipeline.Commands[0].MergeMyResults(PipelineResultTypes.Error, PipelineResultTypes.Output);         psresults = pipeline.Invoke();       } return psresults;
Revision: 28527
Initial Code
Initial URL
Initial Description
Initial Title
Initial Tags
Initial Language
at July 9, 2010 04:13 by markshoe
Initial Code
string cmdArg = ".\script.ps1 -foo bar" Â Â Â Â Â Â Collection<PSObject> psresults; using (Pipeline pipeline = _runspace.CreatePipeline()) Â Â Â Â Â Â { Â Â Â Â Â Â Â Â pipeline.Commands.AddScript(cmdArg); Â Â Â Â Â Â Â Â pipeline.Commands[0].MergeMyResults(PipelineResultTypes.Error, PipelineResultTypes.Output); Â Â Â Â Â Â Â Â psresults = pipeline.Invoke(); Â Â Â Â Â Â } return psresults;
Initial URL
Initial Description
Initial Title
Execute a powershell script from c#
Initial Tags
Initial Language
C#