PowerShell.AddStatement
Method
Definition
Adds an additional statement for execution
For example,
<pre><code>
Runspace rs = RunspaceFactory.CreateRunspace();
PowerShell ps = PowerShell.Create();
ps.Runspace = rs;
ps.AddCommand("Get-Process").AddArgument("idle");
ps.AddStatement().AddCommand("Get-Service").AddArgument("audiosrv");
ps.Invoke();
</code></pre>
public System.Management.Automation.PowerShell AddStatement ();
Returns
A PowerShell instance with the items in parameters added
to the parameter list of the last command.