Get-Item hands you one object for the exact path you give it, whether that’s a file, a folder or a registry key. In PowerShell it doesn’t list what’s inside a folder; it returns the folder itself:
Get-Item -Path 'C:\Reports\denver-q1.csv'
In this tutorial, I’ll walk you through Get-Item in PowerShell on a small sample folder: file properties, wildcards, -LiteralPath, hidden files, data streams, missing items and the other drives it reads.
Quick answer: these are the forms you’ll use most:
| Goal | Command |
|---|---|
| Get one file or folder | Get-Item -Path C:\Reports\q1.csv |
| Get a folder’s contents | Get-Item -Path C:\Reports\* |
| Path with [ ] in the name | Get-Item -LiteralPath 'C:\Reports\q1 [final].csv' |
| Include hidden items | Get-Item -Path C:\Reports\* -Force |
| List data streams | Get-Item -Path C:\Reports\q1.csv -Stream * |
Build a sample folder to follow along
Every example below reads the same Sales folder, so you can run them yourself. Open PowerShell 7 or Windows PowerShell 5.1, paste this script, and press Enter:
$folder = 'C:\psfaqs\t\getitem\Sales'
Remove-Item -Path $folder -Recurse -Force -ErrorAction SilentlyContinue
New-Item -Path "$folder\Archive" -ItemType Directory -Force | Out-Null
'Region,Amount', 'Denver,1250.00' | Set-Content -Path "$folder\denver-q1.csv"
'Region,Amount', 'Austin,980.50' | Set-Content -Path "$folder\austin-q1.csv"
'Region,Amount', 'Denver,1100.00' | Set-Content -Path "$folder\Archive\denver-q2.csv"
'Call Tom Baker on Monday' | Set-Content -Path "$folder\notes.txt"
'Final numbers' | Set-Content -LiteralPath "$folder\report [final].txt"
'owner=Maria Lopez' | Set-Content -Path "$folder\config.ini"
Set-Content -Path "$folder\denver-q1.csv" -Stream Zone.Identifier -Value '[ZoneTransfer]', 'ZoneId=3'
Set-Content -Path "$folder\Archive" -Stream Owner -Value 'Dana Reyes'
Get-ChildItem -Path $folder -Recurse | ForEach-Object { $_.LastWriteTime = [datetime]'2026-11-18 09:30' }
(Get-Item -Path "$folder\config.ini").Attributes = 'Hidden'
Get-ChildItem -Path $folder -Recurse -Force -Name
Output:
Archive
austin-q1.csv
config.ini
denver-q1.csv
notes.txt
report [final].txt
Archive\denver-q2.csv
It creates two CSV files, a note, a file with brackets in its name, a hidden config.ini and an Archive subfolder. It also adds two data streams and sets every date to November 18, 2026, which is why the dates below match.
Change the folder path if you like. If you’re new to listing folders, my guide to Get-ChildItem in PowerShell explains the -Recurse and -Name switches used on the last line.
How to get a file with Get-Item
Point Get-Item at a file and you get a FileInfo object. Its properties hold the size, dates and attributes, so you don’t need a second command to read them:
$file = Get-Item -Path 'C:\psfaqs\t\getitem\Sales\denver-q1.csv'
"Name: $($file.Name)"
"Type: $($file.GetType().FullName)"
"Size: $($file.Length) bytes"
"Modified: $($file.LastWriteTime.ToString('yyyy-MM-dd HH:mm'))"
"Attributes: $($file.Attributes)"
"Mode: $($file.Mode)"
"Folder: $($file.DirectoryName)"
Output:
Name: denver-q1.csv
Type: System.IO.FileInfo
Size: 31 bytes
Modified: 2026-11-18 09:30
Attributes: Archive
Mode: -a---
Folder: C:\psfaqs\t\getitem\Sales
