title: Powershell commandline with pipes error using Exchange 2010
body: <p>Being new to powershell and used to oneliners in unix I find powershell strange. The below code gives me a "too many pipes" type of error. Can anyone tell me what I am doing wrong. My last step will be to add code that adds permission if not found in the else block.</p>
  
  <pre><code>[PS] C:\Windows\system32&gt;(Get-mailbox -identity moh | select alias, distinguishedname) | foreach-object -process { if($_.distinguishedname -match "HK1|VO[1-9]") { $alias = $_.alias; get-mailboxfolderstatistics -identity $alias | Where {$_.FolderType -eq 'Calendar'} | %{ $calpath = $_.folderpath.substring(1); Get-MailboxFolderPermission -Identity $alias":\"$calpath -User iTell | %{ if($_.AccessRights -eq 'Editor') { write-host "Editor!" } else { write-host $_.AccessRights }} } } }
  </code></pre>
  
  <p>I get the following error.</p>
  
  <pre><code>Pipeline not executed because a pipeline is already executing. Pipelines cannot be executed concurrently.
  + CategoryInfo          : OperationStopped:   (Microsoft.Power...tHelperRunspace:ExecutionCmdletHelperRunspace) [], PSInvalidOperationException
  + FullyQualifiedErrorId : RemotePipelineExecutionFailed
  </code></pre>