concept pipeline input in category powershell

appears as: pipeline input
Learn PowerShell Scripting in a Month of Lunches

This is an excerpt from Manning's book Learn PowerShell Scripting in a Month of Lunches.

PS C:\> "frances" | set-foo
set-foo : The input object cannot be bound to any parameters for the
command either because the command does not take
pipeline input or the input and its properties do not match any of the
parameters that take pipeline input.
At line:1 char:13
+ "frances" | set-foo
+             ~~~~~~~
    + CategoryInfo          : InvalidArgument: (frances:String) [Set-Foo],
ParameterBindingException
    + FullyQualifiedErrorId : InputObjectNotBound,Set-Foo

What if you get into a situation where you have an object in the pipeline and a command ready to receive it, but neither ByValue nor ByPropertyName works? It’s entirely possible—the command may not be able to do anything with the type of object in the pipeline, for example, or may not accept pipeline input at all. This should be rare, and we created a simple PowerShell command to demonstrate:

PS C:\> "frances" | set-foo
set-foo : The input object cannot be bound to any parameters for the
command either because the command does not take
pipeline input or the input and its properties do not match any of the
parameters that take pipeline input.
At line:1 char:13
+ "frances" | set-foo
+             ~~~~~~~
    + CategoryInfo          : InvalidArgument: (frances:String) [Set-Foo],
ParameterBindingException
    + FullyQualifiedErrorId : InputObjectNotBound,Set-Foo

This enables ByValue binding of pipeline input. You can enable this for only one parameter per data type. Because $ComputerName is a [string], it’s therefore the only [string] parameter we can mark as accepting pipeline input ByValue.