You can use the If clause:
if ($variable -eq "value"){$output | AnotherFunction} else {$output}
The example is implemented as a symbol:
filter myfilter{ if ($variable -eq "value"){$_ | AnotherFunction} else {$_} }
Then:
$variable = <some value> get-something | myfilter
source share