title: Pipeline semantics aren't propagated into Where-Object
body: <p>I use the following command to run a pipeline.</p>
  
  <pre><code>.\Find-CalRatioSamples.ps1 data16 `
      | ? {-Not (Test-GRIDDataset -JobName DiVertAnalysis -JobVersion 13 -JobSourceDatasetName $_  -Exists -Location UWTeV-linux)}
  </code></pre>
  
  <p>The first is a custom script of mine, and runs very fast (miliseconds). The second is a custom command, also written by me (see <a href="https://github.com/LHCAtlas/AtlasSSH/blob/master/PSAtlasDatasetCommands/TestGRIDDataset.cs" rel="nofollow noreferrer">https://github.com/LHCAtlas/AtlasSSH/blob/master/PSAtlasDatasetCommands/TestGRIDDataset.cs</a>). It is very slow.</p>
  
  <p>Actually, it isn't so slow processing each line of input. The setup before the first line of input can be processed is very expensive. That done, however, it goes quite quickly. So all the expensive code gets executed once, and only the fairly fast code needs to be executed for each new pipeline input.</p>
  
  <p>Unfortunately, when I want to do the ? { } construct above, it seems like PowerShell doesn't keep the pipe-line as it did before. It now calls me command a fresh time for each line of input, causing the command to redo all the setup for each line.</p>
  
  <p>Is there something I can change in how I invoke the pipe-line? Or in how I've coded up my cmdlet to prevent this from happening? Or am I stuck because this is just the way Where-Object works?</p>