Input output (I/O) Redirection in Windows Powershell

Input output redirection allows you to redirect the output of Cmdlet to file or any other valid storage device.

  1. Out-Null : This command sends output to null device. It is same as /dev/null in Linux.
  2. Out-File : This command sends output to the file.
  3. Out-Printer : This command sends output to a printer.
  4. Out-GridView : This command sends output in GUI window.
  5. Out-String : This command sends output as a string to host.
  6. Out-Default :
  7. Out-Host:


Output Redirection

For example – If you execute command “Get-Process”, output is displayed on the screen. But if you want to store that information in a file, you can redirect the output to file using below command.

Get-Process > ProcessList.txt

Input Redirection

Similarly we can redirect input as well. Instead of reading input from standard input stream (Keyboard), we can read from file stream or any other valid stream.

You may also like...