# add '-recurse' to include sub folders
Get-ChildItem -Path $directory -Filter "*.CSV"
This command will return all the files in a directory and returns the ones that match the filter criteria. Include ‘-recurse’ parameter to also return sub folders
PS C:\> $directory = "C:\temp" >> Get-ChildItem -Path $directory -Filter "*.CSV" Directory: C:\temp Mode LastWriteTime Length Name ---- ------------- ------ ---- -a---- 6/19/2019 11:45 AM 528685 temp01.csv -a---- 6/19/2019 11:45 AM 528685 temp02.csv