COMMAND EVERYTHING.
Read an entire local text file as one string for further processing.
PowerShell · Risk: Low · Documentation VerifiedLast verified: 2026-10-26
Returns file contents without parsing JSON. Large files consume memory and sensitive contents must be protected.
Get-Content [-ReadCount <Int64>] [-TotalCount <Int64>] [-Tail <Int32>] [-Path] <String[]>
[-Filter <String>] [-Include <String[]>] [-Exclude <String[]>] [-Force]
[-Credential <PSCredential>] [-Delimiter <String>] [-Wait] [-Raw] [-Encoding <Encoding>]
[-AsByteStream] [-Stream <String>] [<CommonParameters>]Copied 0 timesNo elevation is required for the in-memory examples. Filesystem operations require read or traversal access to the selected path.
PowerShell · 7.6; filesystem examples require the FileSystem provider
-RawPowerShell 7.6 with Microsoft.PowerShell.Management. For file examples, replace the sample path with an accessible file or directory.
Low risk for the supplied example. Protect file contents, paths, and returned system metadata. Review any modifications to the example before execution.
Get-Content -LiteralPath './config.json' -RawReturns file contents without parsing JSON. Large files consume memory and sensitive contents must be protected.
Sign in to keep your own command reference lists.
Explain or customize this command with AI