PowerShell Get-Content: Complete Guide with Examples [2024]
The Get-Content cmdlet is one of PowerShellβs essential tools for reading and processing file contents. It reads text from files, returns it as strings or arrays, and integrates seamlessly with the pipeline for powerful text processing workflows.
Whether youβre processing log files, reading configuration files, parsing CSV data, or performing text manipulation, Get-Content is the foundation for file I/O operations in PowerShell.
In this comprehensive guide, weβll cover everything you need to know about PowerShell Get-Content, from basic file reading to advanced techniques with real-world examples.
Table of Contents
- What is Get-Content?
- Why Use Get-Content?
- Get-Content Syntax
- Basic File Reading
- Reading Specific Lines
- Reading with Filters
- Raw Content Reading
- Path Variations
- File Encoding
- Reading Large Files
- Error Handling
- Get-Content vs Format-Table
- Real-World Use Cases
- Common Mistakes
- Best Practices
- Troubleshooting
- FAQs
- Conclusion
- Related Articles
What is Get-Content? {#what-is-get-content}
Get-Content (alias: gc or cat) is a PowerShell cmdlet that reads the content of a file and outputs it as strings (for individual lines) or as a string array (for multiple lines).
Key Characteristics:
- Reads text files line-by-line or as complete content
- Returns results that can be piped to other cmdlets
- Supports various encodings (UTF-8, ASCII, Unicode, etc.)
- Can read specific lines or ranges
- Works with wildcards for multiple files
- Integrates seamlessly with the PowerShell pipeline
Why Use Get-Content? {#why-use-get-content}
Get-Content is essential for:
- Reading log files - Parse system and application logs
- Configuration processing - Load and parse config files
- Text manipulation - Filter, transform, and process text
- Data extraction - Pull specific data from files
- Monitoring - Track file changes and new content
- File consolidation - Combine multiple files
- Text analysis - Count words, find patterns, extract data
Get-Content Syntax {#syntax}
Get-Content [-Path] <string[]> [parameters]
```powershell
### Common Parameters
| Parameter | Description | Example |
|-----------|-------------|---------|
| `-Path` | Path to file(s) | `-Path "C:\log.txt"` |
| `-LiteralPath` | Exact path (no wildcards) | `-LiteralPath "C:\[file].txt"` |
| `-First` | Get first N lines | `-First 10` |
| `-Last` | Get last N lines | `-Last 5` |
| `-Skip` | Skip first N lines | `-Skip 10` |
| `-Pattern` | Match lines (regex) | `-Pattern "ERROR"` |
| `-Encoding` | File encoding | `-Encoding UTF8` |
| `-Raw` | Read as single string | `-Raw` |
| `-Delimiter` | Field delimiter | `-Delimiter ","` |
| `-TotalCount` | Total lines to return | `-TotalCount 100` |
| `-Wait` | Monitor file changes | `-Wait` |
| `-ReadCount` | Lines per batch | `-ReadCount 1000` |
## Basic File Reading {#basic-reading}
### Read Entire File {#read-entire-file}
```powershell
# Read all content from file
Get-Content "C:\Logs\application.log"
# Using alias
gc "C:\Logs\application.log"
# Using cat (common for Linux users)
cat "C:\Logs\application.log"
```powershell
**Output:** Each line of the file is displayed
### Read as String Array {#read-as-array}
```powershell
# Store content in array
$lines = Get-Content "C:\Logs\application.log"
# Access individual lines
$firstLine = $lines[0]
$lastLine = $lines[-1]
# Count lines
$lineCount = $lines.Count
Write-Host "Total lines: $lineCount"
```powershell
### Read as Single String {#read-single-string}
```powershell
# Read entire file as single string (not array of lines)
$content = Get-Content "C:\Logs\application.log" -Raw
# Check type
$content.GetType() # Returns: System.String (not array)
# Use string methods
if ($content -match "ERROR") {
Write-Host "File contains errors"
}
```powershell
## Reading Specific Lines {#specific-lines}
### First N Lines {#first-lines}
```powershell
# Get first 10 lines
Get-Content "C:\Logs\application.log" -First 10
# Get first line only
$firstLine = Get-Content "C:\Logs\application.log" -First 1
# Real-world: Check log header
$header = Get-Content "data.csv" -First 1
Write-Host "CSV Header: $header"
```powershell
### Last N Lines {#last-lines}
```powershell
# Get last 10 lines (most recent)
Get-Content "C:\Logs\application.log" -Last 10
# Get last line only
$lastLine = Get-Content "C:\Logs\application.log" -Last 1
# Real-world: Check file end
$finalLine = Get-Content "C:\export.txt" -Last 1
if ($finalLine -like "*Success*") {
Write-Host "Export completed successfully"
}
```powershell
### Skip Lines {#skip-lines}
```powershell
# Skip first 10 lines, read rest
Get-Content "C:\Logs\application.log" -Skip 10
# Skip first 5, get next 10 (pagination)
Get-Content "data.txt" -Skip 5 -First 10
# Skip header line, process data
$dataLines = Get-Content "export.csv" -Skip 1
foreach ($line in $dataLines) {
# Process each data line without header
$fields = $line -split ","
Write-Host "Processing: $($fields[0])"
}
```powershell
### Get Line by Number {#line-by-number}
```powershell
# Get specific line (e.g., line 50)
$lines = Get-Content "C:\Logs\application.log"
$line50 = $lines[49] # Arrays are 0-indexed
# Get multiple specific lines
$specificLines = $lines[10, 20, 30, 50]
# Get range of lines (lines 10-20)
$rangeLines = $lines[9..19]
```powershell
## Reading with Filters {#reading-filters}
### Pattern Matching {#pattern-matching}
```powershell
# Get lines containing "ERROR"
Get-Content "C:\Logs\application.log" -Pattern "ERROR"
# Case-sensitive error matching
Get-Content "C:\Logs\application.log" -Pattern "^ERROR" # Starts with ERROR
# Multiple patterns (use regex OR)
Get-Content "C:\Logs\application.log" -Pattern "(ERROR|CRITICAL|FAILED)"
# Lines NOT matching pattern
Get-Content "C:\Logs\application.log" | Where-Object { $_ -notmatch "DEBUG" }
```powershell
### Case Sensitivity {#case-sensitivity}
```powershell
# Get-Content -Pattern is case-insensitive by default
Get-Content "file.log" -Pattern "error" # Matches "ERROR", "Error", "error"
# Use Where-Object for case-sensitive matching
$lines = Get-Content "file.log"
$lines | Where-Object { $_ -cmatch "ERROR" } # Only exact case
```powershell
### Exclude Lines {#exclude-lines}
```powershell
# Filter out debug lines
$lines = Get-Content "application.log"
$filtered = $lines | Where-Object { $_ -notmatch "DEBUG|VERBOSE" }
# Remove blank lines
$noBlank = $lines | Where-Object { $_.Trim() -ne "" }
# Remove lines starting with #
$noComments = $lines | Where-Object { $_ -notmatch "^#" }
```powershell
## Raw Content Reading {#raw-content}
```powershell
# Read file as single string (preserves formatting)
$content = Get-Content "C:\config.txt" -Raw
# Useful for XML/JSON files
$json = Get-Content "config.json" -Raw | ConvertFrom-Json
# Keep line breaks
$text = Get-Content "document.txt" -Raw
$lineCount = ($text | Measure-Object -Line).Lines
```powershell
## Path Variations {#path-variations}
### Absolute Paths {#absolute-paths}
```powershell
# Full path on local machine
Get-Content "C:\Logs\application.log"
# Full path on another drive
Get-Content "D:\Data\export.txt"
```powershell
### Relative Paths {#relative-paths}
```powershell
# Relative to current directory
Get-Content ".\config.txt"
# Parent directory
Get-Content "..\logs\app.log"
# Multiple levels up
Get-Content "..\..\data\file.txt"
```powershell
### UNC Paths {#unc-paths}
```powershell
# Network path
Get-Content "\\Server\Share\Logs\application.log"
# With credentials
$cred = Get-Credential
Get-Content "\\Server\Share\file.txt" -Credential $cred
```powershell
### Wildcard Paths {#wildcard-paths}
```powershell
# Read multiple log files
Get-Content "C:\Logs\*.log"
# All text files in directory
Get-Content "C:\Data\*.txt"
# Recursive with wildcards
Get-Content "C:\Logs\**\*.log"
# Multiple specific files
Get-Content @("file1.txt", "file2.txt", "file3.txt")
```powershell
## File Encoding {#file-encoding}
```powershell
# Read UTF-8 file (default)
Get-Content "file.txt" -Encoding UTF8
# Read ASCII file
Get-Content "file.txt" -Encoding ASCII
# Read Unicode file
Get-Content "file.txt" -Encoding Unicode
# Read UTF-8 with BOM
Get-Content "file.txt" -Encoding UTF8BOM
# Auto-detect encoding
$content = Get-Content "file.txt" # Auto-detection
# Common encodings
# ASCII, BigEndianUnicode, Default, UTF7, UTF8, UTF32, Unicode
```powershell
## Reading Large Files {#large-files}
### Memory Optimization {#memory-optimization}
**Problem:** Loading entire large file into memory
```powershell
# β Inefficient - loads entire 1GB file into memory
$allLines = Get-Content "large-file.log"
$count = $allLines.Count
# β
Better - processes line-by-line
$count = 0
Get-Content "large-file.log" | ForEach-Object {
$count++
}
# β
Best - use ReadCount for batching
Get-Content "large-file.log" -ReadCount 1000 | ForEach-Object {
# Process 1000 lines at a time
$lineCount = $_.Count
}
```powershell
### Performance Comparison {#performance-comparison}
```powershell
# Test 1: Load entire file
Measure-Command {
$lines = Get-Content "large-file.log"
}
# Test 2: Process line-by-line
Measure-Command {
Get-Content "large-file.log" | ForEach-Object {
$processed = $_
}
}
# Test 3: ReadCount batching
Measure-Command {
Get-Content "large-file.log" -ReadCount 1000 | ForEach-Object {
$batch = $_
}
}
```powershell
**Typical Results:**
```powershell
Load entire file: 2500ms (memory-intensive)
Line-by-line: 3000ms (slower, low memory)
Batching (1000 lines): 1200ms (best balance)
```powershell
### Streaming Content {#streaming-content}
```powershell
# Real-time log monitoring
Get-Content "C:\Logs\app.log" -Wait
# Monitor for specific errors
Get-Content "C:\Logs\app.log" -Wait | Where-Object { $_ -match "ERROR" }
# Stop monitoring (Ctrl+C)
```powershell
## Error Handling {#error-handling}
```powershell
# Check if file exists
if (Test-Path "C:\Logs\application.log") {
$content = Get-Content "C:\Logs\application.log"
} else {
Write-Host "File not found"
}
# Use ErrorAction
try {
$content = Get-Content "nonexistent.txt" -ErrorAction Stop
}
catch {
Write-Host "Error reading file: $_"
}
# Suppress errors
Get-Content "file.txt" -ErrorAction SilentlyContinue
# Handle multiple files
$files = "file1.txt", "file2.txt", "file3.txt"
foreach ($file in $files) {
try {
Get-Content $file -ErrorAction Stop
}
catch {
Write-Host "Error reading $file : $_"
}
}
```powershell
## Get-Content vs Format-Table {#get-content-vs-format}
**Important:** Don't use Format cmdlets with Get-Content results for further processing.
```powershell
# β Wrong: Breaks pipeline
Get-Content "data.csv" | Format-Table | Where-Object { $_ -match "value" } # ERROR
# β
Correct: Process then format
Get-Content "data.csv" | Where-Object { $_ -match "value" } | Format-Table
```powershell
## Real-World Use Cases {#use-cases}
### 1. Log File Analysis {#log-files}
```powershell
# Count errors in log file
$logFile = "C:\Logs\application.log"
$errorLines = Get-Content $logFile | Where-Object { $_ -match "ERROR|CRITICAL" }
Write-Host "Total errors: $($errorLines.Count)"
# Get recent errors
$recentErrors = Get-Content $logFile -Last 100 | Where-Object { $_ -match "ERROR" }
foreach ($error in $recentErrors) {
Write-Host "Error: $error" -ForegroundColor Red
}
# Summary by error type
$errors = Get-Content $logFile | Where-Object { $_ -match "ERROR|WARNING" }
$summary = @{}
foreach ($line in $errors) {
if ($line -match "(ERROR|WARNING):\s*(.+)$") {
$errorType = $matches[1]
if ($summary.ContainsKey($errorType)) {
$summary[$errorType]++
} else {
$summary[$errorType] = 1
}
}
}
$summary | Format-Table -AutoSize
```powershell
### 2. Configuration Processing {#configuration}
```powershell
# Parse configuration file
$configFile = "C:\config\app.config"
$config = @{}
Get-Content $configFile | Where-Object { $_ -notmatch "^#|^$" } | ForEach-Object {
if ($_ -match "^(\w+)=(.+)$") {
$key = $matches[1]
$value = $matches[2]
$config[$key] = $value
}
}
$config | Format-Table -AutoSize
# Use config values
$server = $config["ServerName"]
$port = $config["Port"]
Write-Host "Connecting to $server : $port"
```powershell
### 3. Text Parsing {#text-parsing}
```powershell
# Extract data from structured text
$dataFile = "C:\Data\export.txt"
$lines = Get-Content $dataFile -Skip 1 # Skip header
$results = @()
foreach ($line in $lines) {
$fields = $line -split "\|" # Pipe-delimited
$result = [PSCustomObject]@{
ID = $fields[0]
Name = $fields[1]
Email = $fields[2]
Status = $fields[3]
}
$results += $result
}
$results | Format-Table -AutoSize
# Export to CSV
$results | Export-Csv "output.csv" -NoTypeInformation
```powershell
### 4. CSV Processing {#csv-processing}
```powershell
# Read and process CSV
$csvFile = "C:\Data\users.csv"
$lines = Get-Content $csvFile
# Parse header
$header = $lines[0] -split ","
$dataLines = $lines | Select-Object -Skip 1
$users = @()
foreach ($line in $dataLines) {
$values = $line -split ","
$user = [PSCustomObject]@{}
for ($i = 0; $i -lt $header.Count; $i++) {
$user | Add-Member -NotePropertyName $header[$i] -NotePropertyValue $values[$i]
}
$users += $user
}
# Filter and display
$users | Where-Object { $_.Status -eq "Active" } | Format-Table
```powershell
### 5. Bulk File Operations {#bulk-operations}
```powershell
# Process multiple log files
$logFiles = Get-ChildItem "C:\Logs\*.log"
$allErrors = @()
foreach ($file in $logFiles) {
$errors = Get-Content $file.FullName |
Where-Object { $_ -match "ERROR" } |
Select-Object @{N='File'; E={$file.Name}}, @{N='Line'; E={$_}}
$allErrors += $errors
}
# Summary report
$allErrors | Group-Object File | ForEach-Object {
Write-Host "File: $($_.Name) - Errors: $($_.Count)"
}
# Export report
$allErrors | Export-Csv "error-report.csv" -NoTypeInformation
```powershell
## Common Mistakes {#common-mistakes}
### 1. Not Checking File Existence
**β Wrong:**
```powershell
$content = Get-Content "file.txt" # Errors if file doesn't exist
```powershell
**β
Correct:**
```powershell
if (Test-Path "file.txt") {
$content = Get-Content "file.txt"
} else {
Write-Host "File not found"
}
```powershell
### 2. Forgetting Encoding Issues
**β Problem:**
```powershell
$content = Get-Content "utf16-file.txt" # Wrong if file is UTF-16
```powershell
**β
Solution:**
```powershell
$content = Get-Content "utf16-file.txt" -Encoding Unicode
```powershell
### 3. Processing Pipeline After Format Cmdlet
**β Wrong:**
```powershell
Get-Content file.txt | Format-Table | Where-Object { $_ -match "value" }
```powershell
**β
Correct:**
```powershell
Get-Content file.txt | Where-Object { $_ -match "value" } | Format-Table
```powershell
### 4. Not Handling Empty Files
**β Problematic:**
```powershell
$lines = Get-Content "empty.txt"
# $lines is $null, not an array!
$lines[0] # Error: Cannot index into $null
```powershell
**β
Safe:**
```powershell
$lines = @(Get-Content "empty.txt")
# Now always an array
if ($lines.Count -gt 0) {
# Process
}
```powershell
### 5. Loading Large Files Into Memory
**β Inefficient:**
```powershell
# Loads 1GB file into memory
$allLines = Get-Content "huge-file.log"
```powershell
**β
Better:**
```powershell
# Stream line-by-line
Get-Content "huge-file.log" | ForEach-Object {
# Process each line
}
```powershell
## Best Practices {#best-practices}
### 1. Always Check File Existence
```powershell
# β
Good practice
if (Test-Path $filePath) {
$content = Get-Content $filePath
}
```powershell
### 2. Handle Encoding Properly
```powershell
# β
Specify encoding when known
$content = Get-Content "file.txt" -Encoding UTF8
```powershell
### 3. Use Quotes for Paths with Spaces
```powershell
# β
Correct
Get-Content "C:\Program Files\config.txt"
# β Incorrect
Get-Content C:\Program Files\config.txt # ERROR
```powershell
### 4. Pipeline Processing for Large Files
```powershell
# β
Memory-efficient
Get-Content "large-file.log" | Where-Object { $_ -match "pattern" }
```powershell
### 5. Use -ReadCount for Performance
```powershell
# β
Fast processing of large files
Get-Content "file.log" -ReadCount 1000 | ForEach-Object {
# Process batch
}
```powershell
### 6. Combine with Other Cmdlets
```powershell
# β
Powerful pipeline operations
Get-Content "data.csv" |
Where-Object { $_ -notmatch "^#" } |
ConvertFrom-Csv |
Where-Object { $_.Status -eq "Active" } |
Format-Table
```powershell
## Troubleshooting {#troubleshooting}
### Issue 1: "Cannot find path"
**Cause:** File doesn't exist or path is wrong
**Solution:**
```powershell
# Verify path exists
if (Test-Path "path\to\file.txt") {
Get-Content "path\to\file.txt"
} else {
Write-Host "Path not found: path\to\file.txt"
}
# Check current directory
Get-Location
```powershell
### Issue 2: Encoding errors - special characters showing incorrectly
**Cause:** Wrong encoding specified
**Solution:**
```powershell
# Try different encodings
Get-Content "file.txt" -Encoding UTF8BOM
Get-Content "file.txt" -Encoding Unicode
Get-Content "file.txt" -Encoding ASCII
```powershell
### Issue 3: "Cannot index into $null"
**Cause:** File is empty or doesn't exist
**Solution:**
```powershell
# Check if content exists
$content = @(Get-Content "file.txt")
if ($content.Count -gt 0) {
$firstLine = $content[0]
}
```powershell
### Issue 4: File is locked
**Cause:** File is open in another process
**Solution:**
```powershell
# Try with -ReadCount to minimize lock time
Get-Content "file.txt" -ReadCount 1000
# Or close the file in the other application
```powershell
### Issue 5: Performance issues with large files
**Cause:** Loading entire file into memory
**Solution:**
```powershell
# Use -ReadCount for batching
Get-Content "large-file.log" -ReadCount 1000
# Or pipe to process line-by-line
Get-Content "large-file.log" | ForEach-Object { }
```powershell
## FAQs {#faqs}
### Q1: What's the difference between Get-Content and cat?
**A:** In PowerShell, `cat` is an alias for Get-Content. They're identical.
### Q2: How do I read a file into a single string?
**A:** Use `-Raw` parameter:
```powershell
$content = Get-Content "file.txt" -Raw
```powershell
### Q3: How do I read only specific lines?
**A:** Use `-First`, `-Last`, or `-Skip`:
```powershell
Get-Content "file.txt" -First 10
Get-Content "file.txt" -Last 5
Get-Content "file.txt" -Skip 10 -First 5
```powershell
### Q4: Can I read binary files with Get-Content?
**A:** No, Get-Content is for text files. Use `Get-Content -Encoding Byte` for binary data.
### Q5: How do I monitor file changes in real-time?
**A:** Use `-Wait` parameter:
```powershell
Get-Content "file.txt" -Wait
```powershell
### Q6: What's the best way to read large files?
**A:** Use `-ReadCount` for batching:
```powershell
Get-Content "large-file.log" -ReadCount 1000
```powershell
### Q7: How do I handle files with spaces in the path?
**A:** Use quotes:
```powershell
Get-Content "C:\My Documents\file.txt"
```powershell
### Q8: Can I read from multiple files at once?
**A:** Yes, use array of paths:
```powershell
Get-Content @("file1.txt", "file2.txt", "file3.txt")
```powershell
### Q9: How do I get specific line numbers?
**A:** Read into array and index:
```powershell
$lines = Get-Content "file.txt"
$line50 = $lines[49] # 0-indexed
```powershell
### Q10: What encoding should I use?
**A:** UTF-8 is most common. Specify if needed:
```powershell
Get-Content "file.txt" -Encoding UTF8
```powershell
### Q11: How do I count lines in a file?
**A:** Use `Measure-Object`:
```powershell
$count = (Get-Content "file.txt" | Measure-Object -Line).Lines
```powershell
### Q12: Can I search for patterns while reading?
**A:** Yes, use `-Pattern`:
```powershell
Get-Content "file.txt" -Pattern "ERROR"
```powershell
### Q13: How do I exclude certain lines?
**A:** Use Where-Object:
```powershell
Get-Content "file.txt" | Where-Object { $_ -notmatch "DEBUG" }
```powershell
### Q14: What happens if I read a locked file?
**A:** PowerShell tries to read it. If exclusive lock, you may get partial data or error.
### Q15: How do I read network file paths?
**A:** Use UNC paths:
```powershell
Get-Content "\\Server\Share\file.txt"
```powershell
## Conclusion {#conclusion}
PowerShell Get-Content is a fundamental cmdlet for reading and processing file content. It's fast, flexible, and integrates seamlessly with the PowerShell pipeline for powerful text processing workflows.
**Key Takeaways:**
- Use Get-Content for reading text files
- Specify encoding when needed (UTF-8, Unicode, ASCII)
- Use `-First`, `-Last`, `-Skip` for line selection
- Use `-Raw` to read as single string
- Use `-ReadCount` for efficient large file processing
- Always check file existence with Test-Path
- Combine with pipeline cmdlets for powerful text processing
- Monitor files in real-time with `-Wait`
**Next Steps:**
- Practice reading and processing various file types
- Master combining Get-Content with pipeline cmdlets
- Optimize large file processing with appropriate parameters
- Build reusable functions for common file operations
- Explore error handling strategies
For more file operations, see our guides on PowerShell Out-File, PowerShell Set-Content, and PowerShell File Operations.
## Related Articles {#related-articles}
### File I/O Operations
- PowerShell Out-File - Writing content to files
- PowerShell Set-Content - Overwriting file content
- [PowerShell Output to File](/powershell-output-to-file) - Append output to files
- [PowerShell Delete Files](/powershell-delete-all-files-in-folder) - Remove files from disk
- PowerShell Copy-Item - Copy files and folders
- [PowerShell Rename Files](/powershell-rename-files) - Rename files and folders
- [PowerShell List Files](/powershell-list-files-in-directory) - Display file listings
### File Filtering & Selection
- [PowerShell Where-Object](/powershell-where-object/) - Filtering content
- [PowerShell Select-Object](/powershell-select-object-multiple-properties/) - Selecting content
- [PowerShell Get-ChildItem Filter](/powershell-get-childitem-with-filter) - Filter files
- [PowerShell Remove Duplicates](/powershell-remove-duplicates-from-array) - Remove duplicate lines
- [PowerShell Count Files](/powershell-count-files-in-folder) - Count matching files
### Data Processing & Transformation
- [PowerShell ForEach-Object](/powershell-foreach-object/) - Processing content
- [PowerShell Strings](/powershell-strings) - String manipulation and parsing
- [PowerShell Replace Strings](/powershell-replace-double-quotes) - Find and replace text
- [PowerShell Hashtables](/powershell-hashtable) - Store parsed data as key-value pairs
- [PowerShell Arrays](/powershell-arrays) - Work with line arrays
- [PowerShell Export CSV](/powershell-export-csv-no-header) - Export parsed data to CSV
- [PowerShell Import CSV](/powershell-import-csv-foreach) - Process CSV files
### Text Analysis & Pattern Matching
- [PowerShell Get First Line](/powershell-get-first-line-of-file) - Read opening lines
- [PowerShell Get Content Remove First Line](/powershell-get-content-remove-first-line) - Skip headers
- [PowerShell Get Content Skip First Line](/powershell-get-content-skip-first-line) - Skip lines
- [PowerShell List Files by Date](/powershell-list-files-by-date) - Sort by date
### Control Flow & Logic
- [PowerShell If-Else Statement](/powershell-if-else-statement) - Conditional file reading
- [PowerShell Switch Statement](/powershell-switch-statement) - Switch-based logic
- [PowerShell For Loops](/powershell-for-loops) - Iterate through lines
- PowerShell Try-Catch - Error handling in file operations
### Functions & Reusability
- [PowerShell Functions](/powershell-functions) - Create reusable file reading functions
- [PowerShell Function Parameters](/powershell-functions) - Parameterize file operations
### File Metadata & Properties
- [PowerShell Get File Properties](/powershell-get-file-properties) - Access file metadata
- [PowerShell Get File Extension](/powershell-get-file-extension) - Extract file extensions
- [PowerShell Get Folder Size](/powershell-get-folder-size-in-gb) - Calculate directory sizes
- [PowerShell File Hash](/powershell-get-file-hash) - Hash file contents
### System Integration & Automation
- [PowerShell Variables](/powershell-variables) - Store file paths and content
- [PowerShell Complete PowerShell Guide](/complete-powershell-guide) - Full PowerShell course with file operations
- [PowerShell Format Table](/powershell-format-table-column-width) - Format parsed output
- [PowerShell Output Table](/powershell-output-table) - Display content in tables
### Advanced Topics
- [PowerShell DateTime Format](/powershell-datetime-format) - Parse date information from logs
- [PowerShell Active Directory Guide](/complete-active-directory-guide) - AD object data retrieval