It seems that the % operation starts script blocks after the pipeline, although about_Script_Blocks indicates the % isn't necessary.
These all work just fine.
get-childitem | % { write-host $_.Name }
{ write-host 'hello' }
% { write-host 'hello' }
But when we add a script block after the pipeline, we need to have the % first.
get-childitem | { write-host $_.Name }