What is Get-Content in PowerShell used for?

PowerShellMicrosoft TechnologiesSoftware & Coding

Get-Content cmdlet in PowerShell is useful for retrieving the contents of the file or the function. This cmdlet is introduced in PowerShell 3.0. When a file is read by this cmdlet, it reads one line at a time and finally returns the whole content as a collection of objects.

Syntax

Get-Content
   [-ReadCount <Int64>]
   [-TotalCount <Int64>]
   [-Tail <Int32>]
   [-Path] <String[]>
   [-LiteralPath] <String[]>
   [-Filter <String>]
   [-Include <String[]>]
   [-Exclude <String[]>]
   [-Force]
   [-Credential <PSCredential>]
   [-Delimiter <String>]
   [-Wait]
   [-Raw]
   [-Encoding <Encoding>]
   [-AsByteStream]
   [-Stream <String>]
   [<CommonParameters>]
raja
Published on 16-Mar-2020 07:44:48
Advertisements