Get-Content The input object cannot be bound to any parameters

I try
1..4 | gc
will error

gc : The input object cannot be bound to any parameters for the command either because the command does not take pip
eline input or the input and its properties do not match any of the parameters that take pipeline input.
At line:1 char:8
+ 1..4 | gc
+        ~~
    + CategoryInfo          : InvalidArgument: (1:Int32) [Get-Content], ParameterBindingException
    + FullyQualifiedErrorId : InputObjectNotBound,Microsoft.PowerShell.Commands.GetContentCommand

gc : The input object cannot be bound to any parameters for the command either because the command does not take pip
eline input or the input and its properties do not match any of the parameters that take pipeline input.
At line:1 char:8
+ 1..4 | gc
+        ~~
    + CategoryInfo          : InvalidArgument: (2:Int32) [Get-Content], ParameterBindingException
    + FullyQualifiedErrorId : InputObjectNotBound,Microsoft.PowerShell.Commands.GetContentCommand

gc : The input object cannot be bound to any parameters for the command either because the command does not take pip
eline input or the input and its properties do not match any of the parameters that take pipeline input.
At line:1 char:8
+ 1..4 | gc
+        ~~
    + CategoryInfo          : InvalidArgument: (3:Int32) [Get-Content], ParameterBindingException
    + FullyQualifiedErrorId : InputObjectNotBound,Microsoft.PowerShell.Commands.GetContentCommand

gc : The input object cannot be bound to any parameters for the command either because the command does not take pip
eline input or the input and its properties do not match any of the parameters that take pipeline input.
At line:1 char:8
+ 1..4 | gc
+        ~~
    + CategoryInfo          : InvalidArgument: (4:Int32) [Get-Content], ParameterBindingException
    + FullyQualifiedErrorId : InputObjectNotBound,Microsoft.PowerShell.Commands.GetContentCommand

but Iike ls -File -Filter *.txt | gc is fine
if I try 1..4 | %{ gc $_} is fine

Why happen this ?

Wing,
Welcome to the forum. :wave:t4:

Before we proceed:

When you post code or sample data or console output please format it as code using the preformatted text button ( </> ). Simply place your cursor on an empty line, click the button and paste your code.
Thanks in advance

Get-Content is meant to get the content of an item. When you pipe integers (the range 1…4) to Get-Content what would you expect to happen? :wink:

Do you want to achieve a certain task?