Write to File
Redirection Operator
Redirection operator in powershell is a shorthand for Out-File
, to mimic the same thing in bash.
ps1
ls > foo.txt
# equivalent to
ls | Out-File foo.txt
1
2
3
2
3
Write Binary Data from External CommandPowerShell 7.4+
PowerShell 7.4 added a experimental feature called PSNativeCommandPreserveBytePipe
to work with external cli that pipes binary stream.
ps1
curl -s -L 'I am a url' > haha.tar.gz
1