Windows PowerShell Out-File Cmdlet

Introduction to Windows PowerShell Out-File

There are many occasions when you need to output the results of a script not to the screen, but want PowerShell to write to a file. In the old DOS days we could use the greater than symbol: ‘>’. However, to redirect PowerShell output we need to master this construction:

SolarWinds’ Network Performance Monitor will help you discover what’s happening on your network. This utility will also guide you through troubleshooting; the dashboard will indicate whether the root cause is a broken link, faulty equipment or resource overload.

What I like best is the way NPM suggests solutions to network problems. Its also has the ability to monitor the health of individual VMware virtual machines. If you are interested in troubleshooting, and creating network maps, then I recommend that you try NPM now.

Think of Out-File as an appendage to the main PowerShell script. From the myriad of possible Out-File examples, I have selected the ComObject named InternetExplorer as a test-bed.

Let us consider the following situation, you employed | Get-Member to review an object’s methods and properties, but now you wish to record the output in a file. Here is a classic job for the Out-File construction.