Usually, once a pipeline runs, you cannot stop it prematurely, even if you already received the information you were seeking. Simply use this filter to stop a pipeline: filter Stop-Pipeline ([ scriptblock ] $condition = { $true }) { $_ if ( & $condition...