Contact Info

Crumbtrail

ActiveXperts.com » Administration » Powershell » Powershell 1.0 » Out-File

Out-File - Powershell 1.0 CmdLet

ActiveXperts Network Monitor ships with integrated Powershell scripts to monitor complex network. The scripts run out of the box
Download the ActiveXperts Network Monitor FREE version now »

Out-File

Description
Send command output to a file

Usage


Options


Example(s)
Send a list of processes to process.txt:

PS C:\>get-process | out-file -filepath C:\docs\process.txt
PS C:\>get-process | out-file C:\docs\process.txt

The same thing, but storing the list of processes in a variable first and truncating the output at 50 characters:

PS C:\>$a = get-process
out-file -filepath C:\docs\process.txt -inputobject $a -width 50

Save a registry key to file :

PS C:\>set-location hklm:\software
PS HKLM:\software>get-acl ODBC | out-file c:\docs\acl.txt -width 200