title: Powershell multiple AddParameter C#
body: <p>I run a PowerShell from within a C# form application. I want to add multiple parameters to my PowerShell command.</p>
  
  <p>But when I enter a second <code>AddParameter</code> call, it failed with the error:</p>
  
  <blockquote>
    <p>System.Management.Automation.ParameterBindingException</p>
  </blockquote>
  
  <p>Code:</p>
  
  <pre><code>PowerShell shell = PowerShell.Create().AddCommand("Get-NetAdapter");
  shell.AddParameter("name", "Ethernet*");
  shell.AddParameter("InterfaceIndex", "5");
  
  foreach (PSObject result in shell.Invoke())
  {
      Console.WriteLine("{0,-24}{1}", result.Members["Name"].Value,
                                      result.Members["InterfaceDescription"].Value);
  } // End foreach.
  </code></pre>
  
  <p>It looks like it only accepts 1 parameter.</p>
  
  <p>There is also a <code>AddParameters</code>, but I'm not able to get this working.</p>
  
  <p>Anyone got any experience with this?</p>