Contact Info

Crumbtrail

ActiveXperts.com » Administration » Powershell » Powershell 3.0 » Get-Content

Get-Content - Powershell 3.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 »

Get-Content

Short description
Gets the contents of a file.

Syntax
Get-Content [-Path] <String[]> [-Credential <PSCredential>] [-Exclude <String[]>] [-Filter <String>] [-Force] [-Include
 <String[]>] [-ReadCount <Int64>] [-Tail <Int32>] [-TotalCount <Int64>] [-UseTransaction [<SwitchParameter>]] [<CommonP
arameters>]
Get-Content [-Credential <PSCredential>] [-Exclude <String[]>] [-Filter <String>] [-Force] [-Include <String[]>] [-Read
Count <Int64>] [-Tail <Int32>] [-TotalCount <Int64>] -LiteralPath <String[]> [-UseTransaction [<SwitchParameter>]] [<Co
mmonParameters>]
Get-Content [-Delimiter <string>] [-Encoding {Unknown | String | Unicode | Byte | BigEndianUnicode | UTF8 | UTF7 | UTF3
2 | Ascii | Default | Oem}] [-Force] [-Raw <switch>] [-Stream <string>] [-Wait] [-UseTransaction] [<CommonParameters>]





Description
The Get-Content cmdlet gets the content of the item at the location specified by the path, such as the text in a file. 
It reads the content one line at a time and returns a collection of objects , each of which represents a line of conten
t.


Beginning in Windows PowerShell 3.0, Get-Content can also get a specified number of lines from the beginning or end of 
an item.

In file system drives, you can use the the Get-Content cmdlet to get content that you display at the command line, save
 in a variable for processing, or write to another file. It is not valid on folders.

Note: This custom cmdlet help file explains how the Get-Content cmdlet works in a file system drive. For information ab
out the Get-Content cmdlet in all drives, type "Get-Help Get-Content -Path $null" or see Get-Content at http://go.micro
soft.com/fwlink/?LinkID=113310.