How to send PowerShell command output to a file

by [Published on 31 July 2014 / Last Updated on 31 July 2014]

Tip explains how to send output to a file.

You can use Out-File PowerShell cmdlet to send output of a PowerShell cmdlet command to a text file as outlined below:

  • Get-Process | Out-File C:\Temp\AllProcesses.txt

To prevent an existing file from being overwritten, use the –NoClobber parameter as shown in below command:

  • Get-Process | Out-File C:\Temp\AllProcesses.txt -NoClobber

About Nirmal Sharma

Nirmal is a MCSEx3, MCITP and was awarded Microsoft MVP award in Directory Services. He is specialized in Directory Services, Microsoft Clustering, Hyper-V, SQL and Exchange and has been involved in Microsoft Technologies since 1994. In his spare time, he offers technical help by writing tips and articles. Nirmal can be reached at nirmal_sharma@mvps.org.

See Also


The Author — Nirmal Sharma

Nirmal Sharma avatar

Nirmal Sharma is a MCSEx3, MCITP and was awarded the Microsoft MVP award in Directory Services and Windows Networking. He specializes in Microsoft Azure, Office 365, Directory Services, Failover Clusters, Hyper-V, PowerShell Scripting and System Center products. Nirmal has been involved with Microsoft Technologies since 1994. In his spare time, he likes to help others and share some of his knowledge by writing tips and articles on various sites and contributing to PowerShell-based Dynamic Packs for www.ITDynamicPacks.Net solutions.

Featured Links