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


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.