2021-10-12 02:18:02 -04:00
|
|
|
# Get-ChildItem
|
|
|
|
|
|
|
|
> List items in a directory.
|
2024-06-07 15:34:32 +05:30
|
|
|
> Note: This command can only be used through PowerShell.
|
2022-10-04 20:36:23 +05:30
|
|
|
> More information: <https://learn.microsoft.com/powershell/module/microsoft.powershell.management/get-childitem>.
|
2021-10-12 02:18:02 -04:00
|
|
|
|
|
|
|
- List all non-hidden items in the current directory:
|
|
|
|
|
|
|
|
`Get-ChildItem`
|
|
|
|
|
|
|
|
- List only directories in the current directory:
|
|
|
|
|
|
|
|
`Get-ChildItem -Directory`
|
|
|
|
|
|
|
|
- List only files in the current directory:
|
|
|
|
|
|
|
|
`Get-ChildItem -File`
|
|
|
|
|
|
|
|
- List items in the current directory, including hidden items:
|
|
|
|
|
|
|
|
`Get-ChildItem -Hidden`
|
|
|
|
|
|
|
|
- List items in a directory other than the current one:
|
|
|
|
|
2023-02-20 17:23:49 +10:00
|
|
|
`Get-ChildItem -Path {{path\to\directory}}`
|