What is Get-Content in PowerShell used for?

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 ]
   [-TotalCount ]
   [-Tail ]
   [-Path] 
   [-LiteralPath] 
   [-Filter ]
   [-Include ]
   [-Exclude ]
   [-Force]
   [-Credential ]
   [-Delimiter ]
   [-Wait]
   [-Raw]
   [-Encoding ]
   [-AsByteStream]
   [-Stream ]
   []
Updated on: 2020-03-16T07:45:32+05:30

443 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements