Get MP3 Tag with PowerShell

Well, it’s Saturday night and I was watching some of the old Powershell tutorials, which I had downloaded from Microsoft Virtual Academy.

THE PROBLEM :

But problem with these downloaded tutorials is that – They have a Default download name, and one can barely understand the Content inside each vedio. see in the below picture.

MP3 Tag

SOLUTION :

Media players like, iTunes and Windows Media Player displays detailed information for all the media files, but where do they get this information from?

MP3 Tag

Answer to this is METADATA of that file .

metadat

So why not  dig this Metadata to get more information about the files and see if we can get something useful, hence the following script.

SCRIPT :

HOW IT WORKS :

Just feed the function with the directory path, where all your .MP3 or .MP4 files are located and you’ll get the MetaData associated with each file, like in the below picture.

MP3 Tag

You can use this MetaData in many different ways, like I used it to Rename the downloaded files to solve my problem in the following animation.

gif

Or, you can move all the songs which you’ve downloaded to a folder Categorized by their respective Album name, this is pretty handy too 😉 using the following script.

and you’ll end up with folder structures with the Album name’s from the MetaData that has all your songs categorized properly within these folders.

folder


ForEach($item in ("C:\Users\Prateek\Downloads\music" |Get-MP3MetaData)){
$Source = $item.Fullname
$Album = $item.Album
Set-Location C:\Music
If(-not (gci | ?{$_.name -eq "$Album" -and $_.PSisContainer}))
{
New-Item -Name $Album -ItemType Directory -Force |Out-Null
}
$destination = "C:\Music\$album"
Move-Item -Path $Source -Destination $destination -Force -Verbose
}

Hoping you’ll find it fun!! 🙂 Happy weekends!


My new book :  PowerShell Scripting Guide to Python

This PowerShell Scripting guide to Python is designed to make readers familiar with syntax, semantics and core concepts of Python language, in an approach that readers can totally relate with the concepts of PowerShell already in their arsenal, to learn Python fast and effectively, such that it sticks with readers for longer time.

“Use what you know to learn what you don’t. ” also known as Associative learning.

Book follows a comparative method to jump start readers journey in Python, but who is the target audience? and who should read this book –

  • Any System Administrator who want to step into Development or Programming roles, and even if you don’t want to be a developer, knowledge of another scripting language will make your skill set more robust.
  • Python Developers who want to learn PowerShell scripting and understand its ease of user and importance to manage any platform.

Python is one of the top programming languages and in fast changing IT scenarios to DevOps and Cloud to the future – Data ScienceArtificial Intelligence (AI) and Machine Learning Python is a must know.

But this PowerShell Scripting guide to Python would be very helpful for you if you already have some knowledge of PowerShell

NOTE! This is a Leanpub “Agile-published” book. That means the book is currently unfinished and in-progress. As I continue to complete the chapters, we will re-publish the book with the new and updated content. Readers will receive an email once a new version is published!

While the book is in progress, please review it and send any feedback or error corrections at prateek@ridicurious.com

Optical Character Recognition

Subscribe to our mailing list

* indicates required