6

PowerShell and Files – Reading, Writing, and Manipulating Data

So far, our PowerShell journey has been on the screen. Wouldn’t it be neat to be able to write the output of our cmdlets to a file somewhere so that we could save it for later or send it to other people? That’s what we’re going to do in this chapter. First, we’re going to look at formatting output for the screen so that we can just focus on the things we’re interested in or present output in a more useful manner. Next, we’re going to look at writing the output to a text file using Out-File. I do this multiple times a day and it’s an incredibly useful technique, but it is very limited, so we’re also going to look at creating Comma-Separated Value (CSV) files for consumption by another ...

Get PowerShell 7 Workshop now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.