Get-Item
Use Get-Item to return the item at a path — file, folder, registry key, or any provider item — to inspect its properties.
Documentation: Microsoft Learn — Get-Item
Syntax
See the command anatomy
Read the command and its supplied arguments. This example requires real PowerShell or its module; this diagram does not execute it.
Get-Item [-Path] <String[]> [-Force] [<CommonParameters>]- Stage 1Get-Item
-Path -Force
Try it
PowerShell example · browser support is limited.
Execution scope: The full example below requires PowerShell outside this browser. You can edit this runner to use the supported practice commands; unsupported syntax returns an explanation.
Follow the objects
Run the command to inspect each stage.
Examples
List all with Get-Item
Show reference output
Sample output · fictional data, shaped like the real thing
Name Length LastWriteTime ------- ------ ------------------ app.log 4096 9/10/2026 11:42 PM
List all with Get-Item (2)
Show reference output
Sample output · fictional data, shaped like the real thing
Name Property ---- -------- HKEY_LOCAL_MACHINE\SOFTWARE ProgramFilesDir : C:\Program Files
List all with Get-Item (3)
Show reference output
Sample output · fictional data, shaped like the real thing
Thumbprint Subject ---------- ------- 5A8C1F3D7A6B1234567890ABCDEF1234567890AB CN=PowerShell Genie Demo
Parameters
Parameter definitions:
-Path-Force
Practical use and troubleshooting
Practical scenario: Use Get-Item when you need to return the item at a path — file, folder, registry key, or any provider item — to inspect its properties. Start with one identified target and inspect the returned values before extending the operation to a list. Keep the identity in your report so you can trace each result back to the object or path that produced it.
Common error and fix: An unexpected wildcard match can select the wrong file. Use -LiteralPath to address the exact name rather than treating brackets or asterisks as wildcard syntax. In an unattended script, capture this failure with its original error record and record which target failed. An empty result and an unsuccessful query must remain distinguishable in the final report.
See also: Get-Content. Get-Content reads the contents of a file; Get-Item returns the file object and its metadata. A file object is not the text stored inside it. Read the linked command before substituting it; similar names do not imply identical inputs or output.
Recap
Get-Item Use Get-Item to return the item at a path — file, folder, registry key, or any provider item — to inspect its properties.
Next: New-Item