Skip to content

Get-Tags & Set-Tags powershell commands

December 12, 2008

Today, a slightly different post, only for the powershell’s users. The idea is to be able to manipulate audio files tags with the powershell, with two commands :

  • Get-Tags to retrieve tags
  • Set-Tags to apply tags to any audio file

So you can pipeline nearly all file location to the first, the result of ls or wild-card patterns. You can modify the resulting object and pipeline to set-tags to re-apply modifications :

ls -recurse | ? { $ -like "*.mp3" } | get-tags | % { $_.Album="Woptidouda"; $_ } | set-tags

You can also transfer tags from a file to another, after re-encoding file for example :

get-tags *.flac | set-tags *.mp3

And finally you can do renaming based on tag information :
Get-Tags *.mp3 | % { if ($_.Track -lt 10) { mv $_.oFullname $($_.oDirectory + "0" + $_.oName) }}

The commands are build upon Taglib #, a library created to extract tags from audio (and video) files.

So here we go :
Tagcmdlet (binary)
Tagcmdlet (src with Taglib #)

Leave a Comment

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: