Redirecting standard input\output in Windows PowerShell
问题 What is the required syntax to redirect standard input/output on Windows PowerShell? On Unix, we use: $./program <input.txt >output.txt How do I execute the same task in PowerShell? 回答1: You can't hook a file directly to stdin, but you can still access stdin. Get-Content input.txt | ./program > output.txt 回答2: For output redirection you can use: command > filename Redirect command output to a file (overwrite) command >> filename APPEND into a file command 2> filename Redirect Errors Input