How to Get All Files in a Directory Using PowerShell
To get all files in a directory with PowerShell, run Get-ChildItem with the folder path and -File. -File leaves out the subfolders: Output: Without -File, you’d get the Archive and node_modules folders in the list too. Use -Directory when you want only folders. I ran every example in PowerShell 7.6 and Windows PowerShell 5.1. Include … Read more