PowerShell for Admins Tips and Tricks Tools Tutorials

Media Sync: Organize Your Photos and Videos with PowerShell

n2501r
2 min read
Share:

Do you have photos and videos that you have taken over the years that are scattered all over the place? Do you want to have all your photos and videos organized? Do you want all your photos and videos to have a standardized naming scheme? If you answered YES to these questions, then this is the post for you. In this post, I will provide you with the PowerShell code and examples for how to use the Media Sync script. The Media Sync script utilizes the Shell.Application COM object to gather file metadata. Only files that have a picture or video metadata type will be processed. The script uses the date taken for pictures and the media created metadata fields to organize the photos and videos. If there is no date taken or media created available for a given file, the script will use the modify date instead. The script also ensures that you won’t have any duplicate files by checking the file hashes of the two files in question. If the script detects duplicate files, it will only keep one copy of the file. There are also tools included to help you cleanup unwanted files or folders, delete empty directories and find duplicate files. The script has a simple menu driven PowerShell GUI similar to what I did in a previous post . The Media Sync PowerShell script provides the following features:

  • COPY all photos and videos in a given folder structure (maintains original file in original location).

  • MOVE all photos and videos in a given folder structure (original file is renamed and moved).

  • Rename the photo or video based on the date the photo or video was taken.

  • Directory structure organized by year and month the photo or video was taken.

  • Ability to delete any empty folders in a given path, this will help with the cleanup process after you have moved photos and videos from the original location.

  • Remove all files based off a given file extension, this will help with the cleanup process after you have moved photos and videos from the original location.

  • Utilize Out-GridView to highlight and delete files or folders, this can be used to cleanup files of any file extension.

  • Find duplicate files in a given directory.

  • View files in a given directory via Out-GridView.

Take a look for yourself at my site:

SpiderZebra.com Nick Richardson (@ChiefNSR)

Related Articles

Aug 31, 2020

NetNeighbor Watch: The PowerShell Alternative To Arpwatch

In this post, we are going to setup NetNeighbor Watch on a Raspberry Pi. NetNeighbor Watch can keep an eye on your network and send you an email when a new host is discovered. NetNeighbor Watch is done completely in PowerShell. The results are very similar to those of arpwatch. NetNeighbor Watch is for anyone that wants more visibility into the wireless or wired devices on their network. We will also setup a weekly email report with all of the known hosts on your network.

Jun 17, 2020

Simple PowerShell GUI

Over the years, I have supported and created multiple types of GUIs. I finally decided a few years ago to create a very simple menu driven PowerShell GUI. I wanted something that was very powerful yet very simple to maintain. I really enjoy automating manual administrative tasks, so that is what drove this project in the first place. Before I created the menu driven PowerShell GUI, I had directories and directories of very specific scripts to do specific tasks.

Mar 28, 2019

Secure Your Powershell Session with JEA and Constrained Endpoints

Index What is a Constrained Endpoint and Why Would I Need One? Setup and Configuration Using our Endpoint What is a constrained endpoint and why would I need one? Powershell constrained endpoints are a means of interacting with powershell in a manner consistent with the principal of least privilege. In Powershell terms, this is referred to as Just-Enough-Administration, or JEA. JEA is very well documented, so this won’t simply be repeating everything those references detail.