ridicurious.com
Productivity

Powershell : How to get a List of the File Names in a Folder using Powershell

When there is a situation in Windows, there has to be some solution using PowerShell. So Once again I’ve something useful for you.

SITUATION:

A folder in my Hard disk has about 300 movies and I want to share this list of movie names with my friend, or I want to compare my list with one of my friend’s collection of movies on his hard disk.

SOLUTION:

Below script will work in above situation, you just need to change few parameters in the script:

First highlighted parameter is the Directory of the folder, where you want the script to search for movie files, and the second highlighted one is the location of the output file to be placed with name Movielist.txt like below.

File list captured with PowerShell

If you want to compare two folders for files that aren’t common, for example – I want to compare movies in my laptop with movies in my friends Hard Disk, just add the following script in the above script and modify the highlighted location with the directory to be compared.

Your output will look something like this :

Happy Learning! 🙂

Related posts

PowerShell Environment Path and Command discovery

Prateek Singh
7 years ago

Query HTTP Status Code detailed information using Powershell

Prateek Singh
7 years ago

31 Must Know Keyboard Shortcuts for Web Browsers

Prateek Singh
9 years ago
Exit mobile version