COMMAND EVERYTHING.
List ordinary files directly inside a directory while excluding child directories.
PowerShell · Risk: Low · Documentation VerifiedLast verified: 2026-10-26
Returns file objects from the current directory. Hidden items and nested directories are not included by this example.
Get-ChildItem [[-Path] <string[]>] [[-Filter] <string>] [-Include <string[]>]
[-Exclude <string[]>] [-Recurse] [-Depth <uint>] [-Force] [-Name]
[<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
-FilePowerShell 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-ChildItem -LiteralPath '.' -FileReturns file objects from the current directory. Hidden items and nested directories are not included by this example.
Sign in to keep your own command reference lists.
Explain or customize this command with AI