title: Calling PowerShell's where-object from C#
body: <p>How can I call <code>Where-Object</code> (without filter) from C#? I can't parse output, because I want to pass it to pipeline(not in example below).</p>
  
  <p>PS:</p>
  
  <pre><code>Get-MailboxPermission username | Where-Object {$_.AccessRights -match "FullAccess" -and $_.IsInherited -eq $False}
  </code></pre>
  
  <p>C#:</p>
  
  <pre><code>Collection&lt;PSObject&gt; results = null;
  
  Command command1 = new Command("Get-MailboxPermission");
  command1.Parameters.Add("Identity", mailbox);
  command1.Parameters.Add("DomainController", _domainController);
  //I cannot use Filter. This is not possible in PS also.
  //command1.Parameters.Add("Filter", "AccessRights -match \"FullAccess\"");
  </code></pre>
  
  <p>This question is simmilar to: <a href="https://stackoverflow.com/questions/14104222/powershell-whereobjectcommand-from-c-sharp">PowerShell WhereObjectCommand from C#</a> That answer is not enough for my problem.</p>