In what context?
# get just directories
Get-ChildItem c:\junk -Dir
OR
Get-ChildItem c:\junk | Where-Object {$_.PsIsContainer}
# get just files
Get-ChildItem c:\junk -File
OR
Get-ChildItem c:\junk | Where-Object {-Not $_.PsIsContainer}
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
I am looking for a way to tell files from Directories.
In what context?
# get just directories
Get-ChildItem c:\junk -Dir
OR
Get-ChildItem c:\junk | Where-Object {$_.PsIsContainer}
# get just files
Get-ChildItem c:\junk -File
OR
Get-ChildItem c:\junk | Where-Object {-Not $_.PsIsContainer}
Hi HarveyLewis-9057,
Powershell can be used to identify folders and files and their properties:
Get-ChildItem -Path C:\Test -Name
Get-ItemProperty C:\Test\Weather.xls | Format-List
The following article may be of use for finding out the required parameters:
You may also find this useful:
-----------------------------------------------------------------------------------------------------------------------------------------------
--If the reply is helpful, please Upvote and Accept as answer--