PowerShell_unix PowerShell is definitely gaining momentum in the windows scripting world but I still hear folks wanting to rely on Unix based tools to get their job done.  In this series of posts I’m going to look at converting some of the more popular Unix based tools to PowerShell.

cat

The Unix “cat” command is used to concatenate and display files.   Given a file or filename list, it will print the contents of that file to standard output.  There are several options in the Unix command that are implemented with the following PowerShell arguments:

Unix PowerShell Description
-b filespec A file or file matching pattern to concatenate.
-n -number Prefix all output lines with line numbers
-b -number_nonblank Prefix nonblank output lines with numbers.
-E -show_ends display “$” at the end of each line.
-T -show_tabs Display TAB characters as “^I”
-s -squeeze_blanks Never more than one consecutive single blank line