Powershell: [Feature Request] '<' operator like in cmd or unix

Created on 30 Oct 2019  ·  1Comment  ·  Source: PowerShell/PowerShell

Summary of the new feature/enhancement

Add the '<' operator like the CMD's o UNIX's one to pass the content of a file (by lines) as stdin input.

Example

With this code:

image

And this file:

image

In CMD ✔️

image

In WSL (with ubuntu 18.04) ✔️

image

In powershell 6.2.3 ❌

image

In powershell 5 ❌

image

I really need it (university) :sob:
Thanks!

FutureIsNow (?)

Issue-Enhancement WG-Engine

Most helpful comment

The equivalent feature in PowerShell is piping from Get-Content. So, in your case,

PS> Get-Content example.txt | py .\print-twice.py
hola
hola

< should probably be supported as well.

>All comments

The equivalent feature in PowerShell is piping from Get-Content. So, in your case,

PS> Get-Content example.txt | py .\print-twice.py
hola
hola

< should probably be supported as well.

Was this page helpful?
0 / 5 - 0 ratings