iTunes

How to fix numerical genres in iTunes

Nobody’s impressed with your 47 albums of “17” music. Numbers will never truly “represent” your Christian Sludgecore tastes. Miley Cyrus hates when the media try to “pigeonhole” her into the “35” genre, because her art is waay deeper than that. My iTunes was (and still is) changing the genres of some tracks to a numerical value. Our finest Interslicers decided to fix it, even if this does require re-running any time you want your genre tags fixed.

This script takes all your tracks, filters out the non-numerical ones (eg your porn groove tracks) and then re-tags the genre field (eg 47) to the corresponding genre (eg Nu Disco).

# Genre definitions here:
# https://de.wikipedia.org/wiki/Liste_der_ID3v1-Genres

$iTunesApp = New-Object -comObject iTunes.Application
$iMainLibrary = $iTunesApp.LibraryPlaylist

# gather all songs into a variable for re-use
$allsongs = $iMainLibrary.Tracks 

# pull out all songs with numerical genres

get-date -displayhint Time
# pull out only numerical values
$badgenresongs = $allsongs |? {$_.genre -match '^\d+$'} 
get-date -displayhint Time
Write-Host " READY " -ForegroundColor Yellow

$badgenresongs.count

function fix-iTunes
{
    foreach ($badgenresong in $badgenresongs)
    {
    $songname = $badgenresong.name
    $songartist = $badgenresong.artist
    $songgenre = $badgenresong.genre
        
        $Input = $badgenresong.Genre
        Switch ($Input)
		{
			# Genre: Blues
			0 	 {
					Write-Host "$songartist - $songname was found with the following genre: $songgenre, this has been updated to: $Genre_Text_Temp" -fore yellow
					$badgenresong.genre = "Blues"
				}
			# Genre: Classic Rock
			1 	 {
					Write-Host "$songartist - $songname was found with the following genre: $songgenre, this has been updated to: $Genre_Text_Temp" -fore yellow
					$badgenresong.genre = "Classic Rock"
					
				}
			# Genre: Country
			2 	 {
					Write-Host "$songartist - $songname was found with the following genre: $songgenre, this has been updated to: $Genre_Text_Temp" -fore yellow
					$badgenresong.genre = "Country"
				}
			# Genre: Dance
			3 	 {
					Write-Host "$songartist - $songname was found with the following genre: $songgenre, this has been updated to: $Genre_Text_Temp" -fore yellow
					$badgenresong.genre = "Dance"
				}
			# Genre: Disco
			4 	 {
					Write-Host "$songartist - $songname was found with the following genre: $songgenre, this has been updated to: $Genre_Text_Temp" -fore yellow
					$badgenresong.genre = "Disco"
				}
			# Genre: Funk
			5 	 {
					Write-Host "$songartist - $songname was found with the following genre: $songgenre, this has been updated to: $Genre_Text_Temp" -fore yellow
					$badgenresong.genre = "Funk"
				}
			# Genre: Grunge
			6 	 {
					Write-Host "$songartist - $songname was found with the following genre: $songgenre, this has been updated to: $Genre_Text_Temp" -fore yellow
					$badgenresong.genre = "Grunge"
				}
			# Genre: Hip-Hop
			7 	 {
					Write-Host "$songartist - $songname was found with the following genre: $songgenre, this has been updated to: $Genre_Text_Temp" -fore yellow
					$badgenresong.genre = "Hip-Hop"
				}
			# Genre: Jazz
			8 	 {
					Write-Host "$songartist - $songname was found with the following genre: $songgenre, this has been updated to: $Genre_Text_Temp" -fore yellow
					$badgenresong.genre = "Jazz"
				}
			# Genre: Metal
			9 	 {
					Write-Host "$songartist - $songname was found with the following genre: $songgenre, this has been updated to: $Genre_Text_Temp" -fore yellow
					$badgenresong.genre = "Metal"
				}
			# Genre: New Age
			10 	 {
					Write-Host "$songartist - $songname was found with the following genre: $songgenre, this has been updated to: $Genre_Text_Temp" -fore yellow
					$badgenresong.genre = "New Age"
				}
			# Genre: Oldies
			11 	 {
					Write-Host "$songartist - $songname was found with the following genre: $songgenre, this has been updated to: $Genre_Text_Temp" -fore yellow
					$badgenresong.genre = "Oldies"
				}
			# Genre: Other
			12 	 {
					Write-Host "$songartist - $songname was found with the following genre: $songgenre, this has been updated to: $Genre_Text_Temp" -fore yellow
					$badgenresong.genre = "Other"
				}
			# Genre: Pop
			13 	 {
					Write-Host "$songartist - $songname was found with the following genre: $songgenre, this has been updated to: $Genre_Text_Temp" -fore yellow
					$badgenresong.genre = "Pop"
				}
			# Genre: Rhythm and Blues
			14 	 {
					Write-Host "$songartist - $songname was found with the following genre: $songgenre, this has been updated to: $Genre_Text_Temp" -fore yellow
					$badgenresong.genre = "Rhythm and Blues"
				}
			# Genre: Rap
			15 	 {
					Write-Host "$songartist - $songname was found with the following genre: $songgenre, this has been updated to: $Genre_Text_Temp" -fore yellow
					$badgenresong.genre = "Rap"
				}
			# Genre: Reggae
			16 	 {
					Write-Host "$songartist - $songname was found with the following genre: $songgenre, this has been updated to: $Genre_Text_Temp" -fore yellow
					$badgenresong.genre = "Reggae"
				}
			# Genre: Rock
			17 	 {
					Write-Host "$songartist - $songname was found with the following genre: $songgenre, this has been updated to: $Genre_Text_Temp" -fore yellow
					$badgenresong.genre = "Rock"
				}
			# Genre: Techno
			18 	 {
					Write-Host "$songartist - $songname was found with the following genre: $songgenre, this has been updated to: $Genre_Text_Temp" -fore yellow
					$badgenresong.genre = "Techno"
				}
			# Genre: Industrial
			19 	 {
					Write-Host "$songartist - $songname was found with the following genre: $songgenre, this has been updated to: $Genre_Text_Temp" -fore yellow
					$badgenresong.genre = "Industrial"
				}
			# Genre: Alternative
			20 	 {
					Write-Host "$songartist - $songname was found with the following genre: $songgenre, this has been updated to: $Genre_Text_Temp" -fore yellow
					$badgenresong.genre = "Alternative"
				}
			# Genre: Ska
			21 	 {
					Write-Host "$songartist - $songname was found with the following genre: $songgenre, this has been updated to: $Genre_Text_Temp" -fore yellow
					$badgenresong.genre = "Ska"
				}
			# Genre: Death Metal
			22 	 {
					Write-Host "$songartist - $songname was found with the following genre: $songgenre, this has been updated to: $Genre_Text_Temp" -fore yellow
					$badgenresong.genre = "Death Metal"
				}
			# Genre: Pranks
			23 	 {
					Write-Host "$songartist - $songname was found with the following genre: $songgenre, this has been updated to: $Genre_Text_Temp" -fore yellow
					$badgenresong.genre = "Pranks"
				}
			# Genre: Soundtrack
			24 	 {
					Write-Host "$songartist - $songname was found with the following genre: $songgenre, this has been updated to: $Genre_Text_Temp" -fore yellow
					$badgenresong.genre = "Soundtrack"
				}
			# Genre: Euro-Techno
			25 	 {
					Write-Host "$songartist - $songname was found with the following genre: $songgenre, this has been updated to: $Genre_Text_Temp" -fore yellow
					$badgenresong.genre = "Euro-Techno"
				}
			# Genre: Ambient
			26 	 {
					Write-Host "$songartist - $songname was found with the following genre: $songgenre, this has been updated to: $Genre_Text_Temp" -fore yellow
					$badgenresong.genre = "Ambient"
				}
			# Genre: Trip-Hop
			27 	 {
					Write-Host "$songartist - $songname was found with the following genre: $songgenre, this has been updated to: $Genre_Text_Temp" -fore yellow
					$badgenresong.genre = "Trip-Hop"
				}
			# Genre: Vocal
			28 	 {
					Write-Host "$songartist - $songname was found with the following genre: $songgenre, this has been updated to: $Genre_Text_Temp" -fore yellow
					$badgenresong.genre = "Vocal"
				}
			# Genre: Jazz & Funk
			29 	 {
					Write-Host "$songartist - $songname was found with the following genre: $songgenre, this has been updated to: $Genre_Text_Temp" -fore yellow
					$badgenresong.genre = "Jazz & Funk"
				}
			# Genre: Fusion
			30 	 {
					Write-Host "$songartist - $songname was found with the following genre: $songgenre, this has been updated to: $Genre_Text_Temp" -fore yellow
					$badgenresong.genre = "Fusion"
				}
			# Genre: Trance
			31 	 {
					Write-Host "$songartist - $songname was found with the following genre: $songgenre, this has been updated to: $Genre_Text_Temp" -fore yellow
					$badgenresong.genre = "Trance"
				}
			# Genre: Classical
			32 	 {
					Write-Host "$songartist - $songname was found with the following genre: $songgenre, this has been updated to: $Genre_Text_Temp" -fore yellow
					$badgenresong.genre = "Classical"
				}
			# Genre: Instrumental
			33 	 {
					Write-Host "$songartist - $songname was found with the following genre: $songgenre, this has been updated to: $Genre_Text_Temp" -fore yellow
					$badgenresong.genre = "Instrumental"
				}
			# Genre: Acid
			34 	 {
					Write-Host "$songartist - $songname was found with the following genre: $songgenre, this has been updated to: $Genre_Text_Temp" -fore yellow
					$badgenresong.genre = "Acid"
				}
			# Genre: House
			35 	 {
					Write-Host "$songartist - $songname was found with the following genre: $songgenre, this has been updated to: $Genre_Text_Temp" -fore yellow
					$badgenresong.genre = "House"
				}
			# Genre: Game
			36 	 {
					Write-Host "$songartist - $songname was found with the following genre: $songgenre, this has been updated to: $Genre_Text_Temp" -fore yellow
					$badgenresong.genre = "Game"
				}
			# Genre: Sound Clip
			37 	 {
					Write-Host "$songartist - $songname was found with the following genre: $songgenre, this has been updated to: $Genre_Text_Temp" -fore yellow
					$badgenresong.genre = "Sound Clip"
				}
			# Genre: Gospel
			38 	 {
					Write-Host "$songartist - $songname was found with the following genre: $songgenre, this has been updated to: $Genre_Text_Temp" -fore yellow
					$badgenresong.genre = "Gospel"
				}
			# Genre: Noise
			39 	 {
					Write-Host "$songartist - $songname was found with the following genre: $songgenre, this has been updated to: $Genre_Text_Temp" -fore yellow
					$badgenresong.genre = "Noise"
				}
			# Genre: Alternative Rock
			40 	 {
					Write-Host "$songartist - $songname was found with the following genre: $songgenre, this has been updated to: $Genre_Text_Temp" -fore yellow
					$badgenresong.genre = "Alternative Rock"
				}
			# Genre: Bass
			41 	 {
					Write-Host "$songartist - $songname was found with the following genre: $songgenre, this has been updated to: $Genre_Text_Temp" -fore yellow
					$badgenresong.genre = "Bass"
				}
			# Genre: Soul
			42 	 {
					Write-Host "$songartist - $songname was found with the following genre: $songgenre, this has been updated to: $Genre_Text_Temp" -fore yellow
					$badgenresong.genre = "Soul"
				}
			# Genre: Punk
			43 	 {
					Write-Host "$songartist - $songname was found with the following genre: $songgenre, this has been updated to: $Genre_Text_Temp" -fore yellow
					$badgenresong.genre = "Punk"
				}
			# Genre: Space
			44 	 {
					Write-Host "$songartist - $songname was found with the following genre: $songgenre, this has been updated to: $Genre_Text_Temp" -fore yellow
					$badgenresong.genre = "Space"
				}
			# Genre: Meditative
			45 	 {
					Write-Host "$songartist - $songname was found with the following genre: $songgenre, this has been updated to: $Genre_Text_Temp" -fore yellow
					$badgenresong.genre = "Meditative"
				}
			# Genre: Instrumental Pop
			46 	 {
					Write-Host "$songartist - $songname was found with the following genre: $songgenre, this has been updated to: $Genre_Text_Temp" -fore yellow
					$badgenresong.genre = "Instrumental Pop"
				}
			# Genre: Instrumental Rock
			47 	 {
					Write-Host "$songartist - $songname was found with the following genre: $songgenre, this has been updated to: $Genre_Text_Temp" -fore yellow
					$badgenresong.genre = "Instrumental Rock"
				}
			# Genre: Ethnic
			48 	 {
					Write-Host "$songartist - $songname was found with the following genre: $songgenre, this has been updated to: $Genre_Text_Temp" -fore yellow
					$badgenresong.genre = "Ethnic"
				}
			# Genre: Gothic
			49 	 {
					Write-Host "$songartist - $songname was found with the following genre: $songgenre, this has been updated to: $Genre_Text_Temp" -fore yellow
					$badgenresong.genre = "Gothic"
				}
			# Genre: Darkwave
			50 	 {
					Write-Host "$songartist - $songname was found with the following genre: $songgenre, this has been updated to: $Genre_Text_Temp" -fore yellow
					$badgenresong.genre = "Darkwave"
				}
			# Genre: Techno-Industrial
			51 	 {
					Write-Host "$songartist - $songname was found with the following genre: $songgenre, this has been updated to: $Genre_Text_Temp" -fore yellow
					$badgenresong.genre = "Techno-Industrial"
				}
			# Genre: Electronic
			52 	 {
					Write-Host "$songartist - $songname was found with the following genre: $songgenre, this has been updated to: $Genre_Text_Temp" -fore yellow
					$badgenresong.genre = "Electronic"
				}
			# Genre: Pop-Folk
			53 	 {
					Write-Host "$songartist - $songname was found with the following genre: $songgenre, this has been updated to: $Genre_Text_Temp" -fore yellow
					$badgenresong.genre = "Pop-Folk"
				}
			# Genre: Eurodance
			54 	 {
					Write-Host "$songartist - $songname was found with the following genre: $songgenre, this has been updated to: $Genre_Text_Temp" -fore yellow
					$badgenresong.genre = "Eurodance"
				}
			# Genre: Dream
			55 	 {
					Write-Host "$songartist - $songname was found with the following genre: $songgenre, this has been updated to: $Genre_Text_Temp" -fore yellow
					$badgenresong.genre = "Dream"
				}
			# Genre: Southern Rock
			56 	 {
					Write-Host "$songartist - $songname was found with the following genre: $songgenre, this has been updated to: $Genre_Text_Temp" -fore yellow
					$badgenresong.genre = "Southern Rock"
				}
			# Genre: Comedy
			57 	 {
					Write-Host "$songartist - $songname was found with the following genre: $songgenre, this has been updated to: $Genre_Text_Temp" -fore yellow
					$badgenresong.genre = "Comedy"
				}
			# Genre: Cult
			58 	 {
					Write-Host "$songartist - $songname was found with the following genre: $songgenre, this has been updated to: $Genre_Text_Temp" -fore yellow
					$badgenresong.genre = "Cult"
				}
			# Genre: Gangsta
			59 	 {
					Write-Host "$songartist - $songname was found with the following genre: $songgenre, this has been updated to: $Genre_Text_Temp" -fore yellow
					$badgenresong.genre = "Gangsta"
				}
			# Genre: Top 40
			60 	 {
					Write-Host "$songartist - $songname was found with the following genre: $songgenre, this has been updated to: $Genre_Text_Temp" -fore yellow
					$badgenresong.genre = "Top 40"
				}
			# Genre: Christian Rap
			61 	 {
					Write-Host "$songartist - $songname was found with the following genre: $songgenre, this has been updated to: $Genre_Text_Temp" -fore yellow
					$badgenresong.genre = "Christian Rap"
				}
			# Genre: Pop/Funk
			62 	 {
					Write-Host "$songartist - $songname was found with the following genre: $songgenre, this has been updated to: $Genre_Text_Temp" -fore yellow
					$badgenresong.genre = "Pop/Funk"
				}
			# Genre: Jungle
			63 	 {
					Write-Host "$songartist - $songname was found with the following genre: $songgenre, this has been updated to: $Genre_Text_Temp" -fore yellow
					$badgenresong.genre = "Jungle"
				}
			# Genre: Native US
			64 	 {
					Write-Host "$songartist - $songname was found with the following genre: $songgenre, this has been updated to: $Genre_Text_Temp" -fore yellow
					$badgenresong.genre = "Native US"
				}
			# Genre: Cabaret
			65 	 {
					Write-Host "$songartist - $songname was found with the following genre: $songgenre, this has been updated to: $Genre_Text_Temp" -fore yellow
					$badgenresong.genre = "Cabaret"
				}
			# Genre: New Wave
			66 	 {
					Write-Host "$songartist - $songname was found with the following genre: $songgenre, this has been updated to: $Genre_Text_Temp" -fore yellow
					$badgenresong.genre = "New Wave"
				}
			# Genre: Psychedelic
			67 	 {
					Write-Host "$songartist - $songname was found with the following genre: $songgenre, this has been updated to: $Genre_Text_Temp" -fore yellow
					$badgenresong.genre = "Psychedelic"
				}
			# Genre: Rave
			68 	 {
					Write-Host "$songartist - $songname was found with the following genre: $songgenre, this has been updated to: $Genre_Text_Temp" -fore yellow
					$badgenresong.genre = "Rave"
				}
			# Genre: Showtunes
			69 	 {
					Write-Host "$songartist - $songname was found with the following genre: $songgenre, this has been updated to: $Genre_Text_Temp" -fore yellow
					$badgenresong.genre = "Showtunes"
				}
			# Genre: Trailer
			70 	 {
					Write-Host "$songartist - $songname was found with the following genre: $songgenre, this has been updated to: $Genre_Text_Temp" -fore yellow
					$badgenresong.genre = "Trailer"
				}
			# Genre: Lo-Fi
			71 	 {
					Write-Host "$songartist - $songname was found with the following genre: $songgenre, this has been updated to: $Genre_Text_Temp" -fore yellow
					$badgenresong.genre = "Lo-Fi"
				}
			# Genre: Tribal
			72 	 {
					Write-Host "$songartist - $songname was found with the following genre: $songgenre, this has been updated to: $Genre_Text_Temp" -fore yellow
					$badgenresong.genre = "Tribal"
				}
			# Genre: Acid Punk
			73 	 {
					Write-Host "$songartist - $songname was found with the following genre: $songgenre, this has been updated to: $Genre_Text_Temp" -fore yellow
					$badgenresong.genre = "Acid Punk"
				}
			# Genre: Acid Jazz
			74 	 {
					Write-Host "$songartist - $songname was found with the following genre: $songgenre, this has been updated to: $Genre_Text_Temp" -fore yellow
					$badgenresong.genre = "Acid Jazz"
				}
			# Genre: Polka
			75 	 {
					Write-Host "$songartist - $songname was found with the following genre: $songgenre, this has been updated to: $Genre_Text_Temp" -fore yellow
					$badgenresong.genre = "Polka"
				}
			# Genre: Retro
			76 	 {
					Write-Host "$songartist - $songname was found with the following genre: $songgenre, this has been updated to: $Genre_Text_Temp" -fore yellow
					$badgenresong.genre = "Retro"
				}
			# Genre: Musical
			77 	 {
					Write-Host "$songartist - $songname was found with the following genre: $songgenre, this has been updated to: $Genre_Text_Temp" -fore yellow
					$badgenresong.genre = "Musical"
				}
			# Genre: Rock n Roll
			78 	 {
					Write-Host "$songartist - $songname was found with the following genre: $songgenre, this has been updated to: $Genre_Text_Temp" -fore yellow
					$badgenresong.genre = "Rock n Roll"
				}
			# Genre: Hard Rock
			79 	 {
					Write-Host "$songartist - $songname was found with the following genre: $songgenre, this has been updated to: $Genre_Text_Temp" -fore yellow
					$badgenresong.genre = "Hard Rock"
				}
			# Genre: Folk
			80 	 {
					Write-Host "$songartist - $songname was found with the following genre: $songgenre, this has been updated to: $Genre_Text_Temp" -fore yellow
					$badgenresong.genre = "Folk"
				}
			# Genre: Folk-Rock
			81 	 {
					Write-Host "$songartist - $songname was found with the following genre: $songgenre, this has been updated to: $Genre_Text_Temp" -fore yellow
					$badgenresong.genre = "Folk-Rock"
				}
			# Genre: National Folk
			82 	 {
					Write-Host "$songartist - $songname was found with the following genre: $songgenre, this has been updated to: $Genre_Text_Temp" -fore yellow
					$badgenresong.genre = "National Folk"
				}
			# Genre: Swing
			83 	 {
					Write-Host "$songartist - $songname was found with the following genre: $songgenre, this has been updated to: $Genre_Text_Temp" -fore yellow
					$badgenresong.genre = "Swing"
				}
			# Genre: Fast Fusion
			84 	 {
					Write-Host "$songartist - $songname was found with the following genre: $songgenre, this has been updated to: $Genre_Text_Temp" -fore yellow
					$badgenresong.genre = "Fast Fusion"
				}
			# Genre: Bebop
			85 	 {
					Write-Host "$songartist - $songname was found with the following genre: $songgenre, this has been updated to: $Genre_Text_Temp" -fore yellow
					$badgenresong.genre = "Bebop"
				}
			# Genre: Latin
			86 	 {
					Write-Host "$songartist - $songname was found with the following genre: $songgenre, this has been updated to: $Genre_Text_Temp" -fore yellow
					$badgenresong.genre = "Latin"
				}
			# Genre: Revival
			87 	 {
					Write-Host "$songartist - $songname was found with the following genre: $songgenre, this has been updated to: $Genre_Text_Temp" -fore yellow
					$badgenresong.genre = "Revival"
				}
			# Genre: Celtic
			88 	 {
					Write-Host "$songartist - $songname was found with the following genre: $songgenre, this has been updated to: $Genre_Text_Temp" -fore yellow
					$badgenresong.genre = "Celtic"
				}
			# Genre: Bluegrass
			89 	 {
					Write-Host "$songartist - $songname was found with the following genre: $songgenre, this has been updated to: $Genre_Text_Temp" -fore yellow
					$badgenresong.genre = "Bluegrass"
				}
			# Genre: Avantgarde
			90 	 {
					Write-Host "$songartist - $songname was found with the following genre: $songgenre, this has been updated to: $Genre_Text_Temp" -fore yellow
					$badgenresong.genre = "Avantgarde"
				}
			# Genre: Gothic Rock
			91 	 {
					Write-Host "$songartist - $songname was found with the following genre: $songgenre, this has been updated to: $Genre_Text_Temp" -fore yellow
					$badgenresong.genre = "Gothic Rock"
				}
			# Genre: Progressive Rock
			92 	 {
					Write-Host "$songartist - $songname was found with the following genre: $songgenre, this has been updated to: $Genre_Text_Temp" -fore yellow
					$badgenresong.genre = "Progressive Rock"
				}
			# Genre: Psychedelic Rock
			93 	 {
					Write-Host "$songartist - $songname was found with the following genre: $songgenre, this has been updated to: $Genre_Text_Temp" -fore yellow
					$badgenresong.genre = "Psychedelic Rock"
				}
			# Genre: Symphonic Rock
			94 	 {
					Write-Host "$songartist - $songname was found with the following genre: $songgenre, this has been updated to: $Genre_Text_Temp" -fore yellow
					$badgenresong.genre = "Symphonic Rock"
				}
			# Genre: Slow Rock
			95 	 {
					Write-Host "$songartist - $songname was found with the following genre: $songgenre, this has been updated to: $Genre_Text_Temp" -fore yellow
					$badgenresong.genre = "Slow Rock"
				}
			# Genre: Big Band
			96 	 {
					Write-Host "$songartist - $songname was found with the following genre: $songgenre, this has been updated to: $Genre_Text_Temp" -fore yellow
					$badgenresong.genre = "Big Band"
				}
			# Genre: Chorus
			97 	 {
					Write-Host "$songartist - $songname was found with the following genre: $songgenre, this has been updated to: $Genre_Text_Temp" -fore yellow
					$badgenresong.genre = "Chorus"
				}
			# Genre: Easy Listening
			98 	 {
					Write-Host "$songartist - $songname was found with the following genre: $songgenre, this has been updated to: $Genre_Text_Temp" -fore yellow
					$badgenresong.genre = "Easy Listening"
				}
			# Genre: Acoustic
			99 	 {
					Write-Host "$songartist - $songname was found with the following genre: $songgenre, this has been updated to: $Genre_Text_Temp" -fore yellow
					$badgenresong.genre = "Acoustic"
				}
			# Genre: Humour
			100 	 {
					Write-Host "$songartist - $songname was found with the following genre: $songgenre, this has been updated to: $Genre_Text_Temp" -fore yellow
					$badgenresong.genre = "Humour"
				}
			# Genre: Speech
			101 	 {
					Write-Host "$songartist - $songname was found with the following genre: $songgenre, this has been updated to: $Genre_Text_Temp" -fore yellow
					$badgenresong.genre = "Speech"
				}
			# Genre: Chanson
			102 	 {
					Write-Host "$songartist - $songname was found with the following genre: $songgenre, this has been updated to: $Genre_Text_Temp" -fore yellow
					$badgenresong.genre = "Chanson"
				}
			# Genre: Opera
			103 	 {
					Write-Host "$songartist - $songname was found with the following genre: $songgenre, this has been updated to: $Genre_Text_Temp" -fore yellow
					$badgenresong.genre = "Opera"
				}
			# Genre: Chamber Music
			104 	 {
					Write-Host "$songartist - $songname was found with the following genre: $songgenre, this has been updated to: $Genre_Text_Temp" -fore yellow
					$badgenresong.genre = "Chamber Music"
				}
			# Genre: Sonata
			105 	 {
					Write-Host "$songartist - $songname was found with the following genre: $songgenre, this has been updated to: $Genre_Text_Temp" -fore yellow
					$badgenresong.genre = "Sonata"
				}
			# Genre: Symphony
			106 	 {
					Write-Host "$songartist - $songname was found with the following genre: $songgenre, this has been updated to: $Genre_Text_Temp" -fore yellow
					$badgenresong.genre = "Symphony"
				}
			# Genre: Booty Bass
			107 	 {
					Write-Host "$songartist - $songname was found with the following genre: $songgenre, this has been updated to: $Genre_Text_Temp" -fore yellow
					$badgenresong.genre = "Booty Bass"
				}
			# Genre: Primus
			108 	 {
					Write-Host "$songartist - $songname was found with the following genre: $songgenre, this has been updated to: $Genre_Text_Temp" -fore yellow
					$badgenresong.genre = "Primus"
				}
			# Genre: Porn Groove
			109 	 {
					Write-Host "$songartist - $songname was found with the following genre: $songgenre, this has been updated to: $Genre_Text_Temp" -fore yellow
					$badgenresong.genre = "Porn Groove"
				}
			# Genre: Satire
			110 	 {
					Write-Host "$songartist - $songname was found with the following genre: $songgenre, this has been updated to: $Genre_Text_Temp" -fore yellow
					$badgenresong.genre = "Satire"
				}
			# Genre: Slow Jam
			111 	 {
					Write-Host "$songartist - $songname was found with the following genre: $songgenre, this has been updated to: $Genre_Text_Temp" -fore yellow
					$badgenresong.genre = "Slow Jam"
				}
			# Genre: Club
			112 	 {
					Write-Host "$songartist - $songname was found with the following genre: $songgenre, this has been updated to: $Genre_Text_Temp" -fore yellow
					$badgenresong.genre = "Club"
				}
			# Genre: Tango
			113 	 {
					Write-Host "$songartist - $songname was found with the following genre: $songgenre, this has been updated to: $Genre_Text_Temp" -fore yellow
					$badgenresong.genre = "Tango"
				}
			# Genre: Samba
			114 	 {
					Write-Host "$songartist - $songname was found with the following genre: $songgenre, this has been updated to: $Genre_Text_Temp" -fore yellow
					$badgenresong.genre = "Samba"
				}
			# Genre: Folklore
			115 	 {
					Write-Host "$songartist - $songname was found with the following genre: $songgenre, this has been updated to: $Genre_Text_Temp" -fore yellow
					$badgenresong.genre = "Folklore"
				}
			# Genre: Ballad
			116 	 {
					Write-Host "$songartist - $songname was found with the following genre: $songgenre, this has been updated to: $Genre_Text_Temp" -fore yellow
					$badgenresong.genre = "Ballad"
				}
			# Genre: Power Ballad
			117 	 {
					Write-Host "$songartist - $songname was found with the following genre: $songgenre, this has been updated to: $Genre_Text_Temp" -fore yellow
					$badgenresong.genre = "Power Ballad"
				}
			# Genre: Rhythmic Soul
			118 	 {
					Write-Host "$songartist - $songname was found with the following genre: $songgenre, this has been updated to: $Genre_Text_Temp" -fore yellow
					$badgenresong.genre = "Rhythmic Soul"
				}
			# Genre: Freestyle
			119 	 {
					Write-Host "$songartist - $songname was found with the following genre: $songgenre, this has been updated to: $Genre_Text_Temp" -fore yellow
					$badgenresong.genre = "Freestyle"
				}
			# Genre: Duet
			120 	 {
					Write-Host "$songartist - $songname was found with the following genre: $songgenre, this has been updated to: $Genre_Text_Temp" -fore yellow
					$badgenresong.genre = "Duet"
				}
			# Genre: Punk Rock
			121 	 {
					Write-Host "$songartist - $songname was found with the following genre: $songgenre, this has been updated to: $Genre_Text_Temp" -fore yellow
					$badgenresong.genre = "Punk Rock"
				}
			# Genre: Drum Solo
			122 	 {
					Write-Host "$songartist - $songname was found with the following genre: $songgenre, this has been updated to: $Genre_Text_Temp" -fore yellow
					$badgenresong.genre = "Drum Solo"
				}
			# Genre: A cappella
			123 	 {
					Write-Host "$songartist - $songname was found with the following genre: $songgenre, this has been updated to: $Genre_Text_Temp" -fore yellow
					$badgenresong.genre = "A cappella"
				}
			# Genre: Euro-House
			124 	 {
					Write-Host "$songartist - $songname was found with the following genre: $songgenre, this has been updated to: $Genre_Text_Temp" -fore yellow
					$badgenresong.genre = "Euro-House"
				}
			# Genre: Dance Hall
			125 	 {
					Write-Host "$songartist - $songname was found with the following genre: $songgenre, this has been updated to: $Genre_Text_Temp" -fore yellow
					$badgenresong.genre = "Dance Hall"
				}
			# Genre: Goa
			126 	 {
					Write-Host "$songartist - $songname was found with the following genre: $songgenre, this has been updated to: $Genre_Text_Temp" -fore yellow
					$badgenresong.genre = "Goa"
				}
			# Genre: Drum & Bass
			127 	 {
					Write-Host "$songartist - $songname was found with the following genre: $songgenre, this has been updated to: $Genre_Text_Temp" -fore yellow
					$badgenresong.genre = "Drum & Bass"
				}
			# Genre: Club-House
			128 	 {
					Write-Host "$songartist - $songname was found with the following genre: $songgenre, this has been updated to: $Genre_Text_Temp" -fore yellow
					$badgenresong.genre = "Club-House"
				}
			# Genre: Hardcore Techno
			129 	 {
					Write-Host "$songartist - $songname was found with the following genre: $songgenre, this has been updated to: $Genre_Text_Temp" -fore yellow
					$badgenresong.genre = "Hardcore Techno"
				}
			# Genre: Terror
			130 	 {
					Write-Host "$songartist - $songname was found with the following genre: $songgenre, this has been updated to: $Genre_Text_Temp" -fore yellow
					$badgenresong.genre = "Terror"
				}
			# Genre: Indie
			131 	 {
					Write-Host "$songartist - $songname was found with the following genre: $songgenre, this has been updated to: $Genre_Text_Temp" -fore yellow
					$badgenresong.genre = "Indie"
				}
			# Genre: BritPop
			132 	 {
					Write-Host "$songartist - $songname was found with the following genre: $songgenre, this has been updated to: $Genre_Text_Temp" -fore yellow
					$badgenresong.genre = "BritPop"
				}
			# Genre: Negerpunk
			133 	 {
					Write-Host "$songartist - $songname was found with the following genre: $songgenre, this has been updated to: $Genre_Text_Temp" -fore yellow
					$badgenresong.genre = "Negerpunk"
				}
			# Genre: Polsk Punk
			134 	 {
					Write-Host "$songartist - $songname was found with the following genre: $songgenre, this has been updated to: $Genre_Text_Temp" -fore yellow
					$badgenresong.genre = "Polsk Punk"
				}
			# Genre: Beat
			135 	 {
					Write-Host "$songartist - $songname was found with the following genre: $songgenre, this has been updated to: $Genre_Text_Temp" -fore yellow
					$badgenresong.genre = "Beat"
				}
			# Genre: Christian Gangsta Rap
			136 	 {
					Write-Host "$songartist - $songname was found with the following genre: $songgenre, this has been updated to: $Genre_Text_Temp" -fore yellow
					$badgenresong.genre = "Christian Gangsta Rap"
				}
			# Genre: Heavy Metal
			137 	 {
					Write-Host "$songartist - $songname was found with the following genre: $songgenre, this has been updated to: $Genre_Text_Temp" -fore yellow
					$badgenresong.genre = "Heavy Metal"
				}
			# Genre: Black Metal
			138 	 {
					Write-Host "$songartist - $songname was found with the following genre: $songgenre, this has been updated to: $Genre_Text_Temp" -fore yellow
					$badgenresong.genre = "Black Metal"
				}
			# Genre: Crossover
			139 	 {
					Write-Host "$songartist - $songname was found with the following genre: $songgenre, this has been updated to: $Genre_Text_Temp" -fore yellow
					$badgenresong.genre = "Crossover"
				}
			# Genre: Contemporary Christian
			140 	 {
					Write-Host "$songartist - $songname was found with the following genre: $songgenre, this has been updated to: $Genre_Text_Temp" -fore yellow
					$badgenresong.genre = "Contemporary Christian"
				}
			# Genre: Christian Rock
			141 	 {
					Write-Host "$songartist - $songname was found with the following genre: $songgenre, this has been updated to: $Genre_Text_Temp" -fore yellow
					$badgenresong.genre = "Christian Rock"
				}
			# Genre: Merengue
			142 	 {
					Write-Host "$songartist - $songname was found with the following genre: $songgenre, this has been updated to: $Genre_Text_Temp" -fore yellow
					$badgenresong.genre = "Merengue"
				}
			# Genre: Salsa
			143 	 {
					Write-Host "$songartist - $songname was found with the following genre: $songgenre, this has been updated to: $Genre_Text_Temp" -fore yellow
					$badgenresong.genre = "Salsa"
				}
			# Genre: Thrash Metal
			144 	 {
					Write-Host "$songartist - $songname was found with the following genre: $songgenre, this has been updated to: $Genre_Text_Temp" -fore yellow
					$badgenresong.genre = "Thrash Metal"
				}
			# Genre: Anime
			145 	 {
					Write-Host "$songartist - $songname was found with the following genre: $songgenre, this has been updated to: $Genre_Text_Temp" -fore yellow
					$badgenresong.genre = "Anime"
				}
			# Genre: Jpop
			146 	 {
					Write-Host "$songartist - $songname was found with the following genre: $songgenre, this has been updated to: $Genre_Text_Temp" -fore yellow
					$badgenresong.genre = "Jpop"
				}
			# Genre: Synthpop
			147 	 {
					Write-Host "$songartist - $songname was found with the following genre: $songgenre, this has been updated to: $Genre_Text_Temp" -fore yellow
					$badgenresong.genre = "Synthpop"
				}
			# Genre: Abstract
			148 	 {
					Write-Host "$songartist - $songname was found with the following genre: $songgenre, this has been updated to: $Genre_Text_Temp" -fore yellow
					$badgenresong.genre = "Abstract"
				}
			# Genre: Art Rock
			149 	 {
					Write-Host "$songartist - $songname was found with the following genre: $songgenre, this has been updated to: $Genre_Text_Temp" -fore yellow
					$badgenresong.genre = "Art Rock"
				}
			# Genre: Baroque
			150 	 {
					Write-Host "$songartist - $songname was found with the following genre: $songgenre, this has been updated to: $Genre_Text_Temp" -fore yellow
					$badgenresong.genre = "Baroque"
				}
			# Genre: Bhangra
			151 	 {
					Write-Host "$songartist - $songname was found with the following genre: $songgenre, this has been updated to: $Genre_Text_Temp" -fore yellow
					$badgenresong.genre = "Bhangra"
				}
			# Genre: Big Beat
			152 	 {
					Write-Host "$songartist - $songname was found with the following genre: $songgenre, this has been updated to: $Genre_Text_Temp" -fore yellow
					$badgenresong.genre = "Big Beat"
				}
			# Genre: Breakbeat
			153 	 {
					Write-Host "$songartist - $songname was found with the following genre: $songgenre, this has been updated to: $Genre_Text_Temp" -fore yellow
					$badgenresong.genre = "Breakbeat"
				}
			# Genre: Chillout
			154 	 {
					Write-Host "$songartist - $songname was found with the following genre: $songgenre, this has been updated to: $Genre_Text_Temp" -fore yellow
					$badgenresong.genre = "Chillout"
				}
			# Genre: Downtempo
			155 	 {
					Write-Host "$songartist - $songname was found with the following genre: $songgenre, this has been updated to: $Genre_Text_Temp" -fore yellow
					$badgenresong.genre = "Downtempo"
				}
			# Genre: Dub
			156 	 {
					Write-Host "$songartist - $songname was found with the following genre: $songgenre, this has been updated to: $Genre_Text_Temp" -fore yellow
					$badgenresong.genre = "Dub"
				}
			# Genre: EBM
			157 	 {
					Write-Host "$songartist - $songname was found with the following genre: $songgenre, this has been updated to: $Genre_Text_Temp" -fore yellow
					$badgenresong.genre = "EBM"
				}
			# Genre: Eclectic
			158 	 {
					Write-Host "$songartist - $songname was found with the following genre: $songgenre, this has been updated to: $Genre_Text_Temp" -fore yellow
					$badgenresong.genre = "Eclectic"
				}
			# Genre: Electro
			159 	 {
					Write-Host "$songartist - $songname was found with the following genre: $songgenre, this has been updated to: $Genre_Text_Temp" -fore yellow
					$badgenresong.genre = "Electro"
				}
			# Genre: Electroclash
			160 	 {
					Write-Host "$songartist - $songname was found with the following genre: $songgenre, this has been updated to: $Genre_Text_Temp" -fore yellow
					$badgenresong.genre = "Electroclash"
				}
			# Genre: Emo
			161 	 {
					Write-Host "$songartist - $songname was found with the following genre: $songgenre, this has been updated to: $Genre_Text_Temp" -fore yellow
					$badgenresong.genre = "Emo"
				}
			# Genre: Experimental
			162 	 {
					Write-Host "$songartist - $songname was found with the following genre: $songgenre, this has been updated to: $Genre_Text_Temp" -fore yellow
					$badgenresong.genre = "Experimental"
				}
			# Genre: Garage
			163 	 {
					Write-Host "$songartist - $songname was found with the following genre: $songgenre, this has been updated to: $Genre_Text_Temp" -fore yellow
					$badgenresong.genre = "Garage"
				}
			# Genre: Global
			164 	 {
					Write-Host "$songartist - $songname was found with the following genre: $songgenre, this has been updated to: $Genre_Text_Temp" -fore yellow
					$badgenresong.genre = "Global"
				}
			# Genre: IDM
			165 	 {
					Write-Host "$songartist - $songname was found with the following genre: $songgenre, this has been updated to: $Genre_Text_Temp" -fore yellow
					$badgenresong.genre = "IDM"
				}
			# Genre: Illbient
			166 	 {
					Write-Host "$songartist - $songname was found with the following genre: $songgenre, this has been updated to: $Genre_Text_Temp" -fore yellow
					$badgenresong.genre = "Illbient"
				}
			# Genre: Industro-Goth
			167 	 {
					Write-Host "$songartist - $songname was found with the following genre: $songgenre, this has been updated to: $Genre_Text_Temp" -fore yellow
					$badgenresong.genre = "Industro-Goth"
				}
			# Genre: Jam Band
			168 	 {
					Write-Host "$songartist - $songname was found with the following genre: $songgenre, this has been updated to: $Genre_Text_Temp" -fore yellow
					$badgenresong.genre = "Jam Band"
				}
			# Genre: Krautrock
			169 	 {
					Write-Host "$songartist - $songname was found with the following genre: $songgenre, this has been updated to: $Genre_Text_Temp" -fore yellow
					$badgenresong.genre = "Krautrock"
				}
			# Genre: Leftfield
			170 	 {
					Write-Host "$songartist - $songname was found with the following genre: $songgenre, this has been updated to: $Genre_Text_Temp" -fore yellow
					$badgenresong.genre = "Leftfield"
				}
			# Genre: Lounge
			171 	 {
					Write-Host "$songartist - $songname was found with the following genre: $songgenre, this has been updated to: $Genre_Text_Temp" -fore yellow
					$badgenresong.genre = "Lounge"
				}
			# Genre: Math Rock
			172 	 {
					Write-Host "$songartist - $songname was found with the following genre: $songgenre, this has been updated to: $Genre_Text_Temp" -fore yellow
					$badgenresong.genre = "Math Rock"
				}
			# Genre: New Romantic
			173 	 {
					Write-Host "$songartist - $songname was found with the following genre: $songgenre, this has been updated to: $Genre_Text_Temp" -fore yellow
					$badgenresong.genre = "New Romantic"
				}
			# Genre: Nu-Breakz
			174 	 {
					Write-Host "$songartist - $songname was found with the following genre: $songgenre, this has been updated to: $Genre_Text_Temp" -fore yellow
					$badgenresong.genre = "Nu-Breakz"
				}
			# Genre: Post-Punk
			175 	 {
					Write-Host "$songartist - $songname was found with the following genre: $songgenre, this has been updated to: $Genre_Text_Temp" -fore yellow
					$badgenresong.genre = "Post-Punk"
				}
			# Genre: Post-Rock
			176 	 {
					Write-Host "$songartist - $songname was found with the following genre: $songgenre, this has been updated to: $Genre_Text_Temp" -fore yellow
					$badgenresong.genre = "Post-Rock"
				}
			# Genre: Psytrance
			177 	 {
					Write-Host "$songartist - $songname was found with the following genre: $songgenre, this has been updated to: $Genre_Text_Temp" -fore yellow
					$badgenresong.genre = "Psytrance"
				}
			# Genre: Shoegaze
			178 	 {
					Write-Host "$songartist - $songname was found with the following genre: $songgenre, this has been updated to: $Genre_Text_Temp" -fore yellow
					$badgenresong.genre = "Shoegaze"
				}
			# Genre: Space Rock
			179 	 {
					Write-Host "$songartist - $songname was found with the following genre: $songgenre, this has been updated to: $Genre_Text_Temp" -fore yellow
					$badgenresong.genre = "Space Rock"
				}
			# Genre: Trop Rock
			180 	 {
					Write-Host "$songartist - $songname was found with the following genre: $songgenre, this has been updated to: $Genre_Text_Temp" -fore yellow
					$badgenresong.genre = "Trop Rock"
				}
			# Genre: World Music
			181 	 {
					Write-Host "$songartist - $songname was found with the following genre: $songgenre, this has been updated to: $Genre_Text_Temp" -fore yellow
					$badgenresong.genre = "World Music"
				}
			# Genre: Neoclassical
			182 	 {
					Write-Host "$songartist - $songname was found with the following genre: $songgenre, this has been updated to: $Genre_Text_Temp" -fore yellow
					$badgenresong.genre = "Neoclassical"
				}
			# Genre: Audiobook
			183 	 {
					Write-Host "$songartist - $songname was found with the following genre: $songgenre, this has been updated to: $Genre_Text_Temp" -fore yellow
					$badgenresong.genre = "Audiobook"
				}
			# Genre: Audio Theatre
			184 	 {
					Write-Host "$songartist - $songname was found with the following genre: $songgenre, this has been updated to: $Genre_Text_Temp" -fore yellow
					$badgenresong.genre = "Audio Theatre"
				}
			# Genre: Neue Deutsche Welle
			185 	 {
					Write-Host "$songartist - $songname was found with the following genre: $songgenre, this has been updated to: $Genre_Text_Temp" -fore yellow
					$badgenresong.genre = "Neue Deutsche Welle"
				}
			# Genre: Podcast
			186 	 {
					Write-Host "$songartist - $songname was found with the following genre: $songgenre, this has been updated to: $Genre_Text_Temp" -fore yellow
					$badgenresong.genre = "Podcast"
				}
			# Genre: Indie Rock
			187 	 {
					Write-Host "$songartist - $songname was found with the following genre: $songgenre, this has been updated to: $Genre_Text_Temp" -fore yellow
					$badgenresong.genre = "Indie Rock"
				}
			# Genre: G-Funk
			188 	 {
					Write-Host "$songartist - $songname was found with the following genre: $songgenre, this has been updated to: $Genre_Text_Temp" -fore yellow
					$badgenresong.genre = "G-Funk"
				}
			# Genre: Dubstep
			189 	 {
					Write-Host "$songartist - $songname was found with the following genre: $songgenre, this has been updated to: $Genre_Text_Temp" -fore yellow
					$badgenresong.genre = "Dubstep"
				}
			# Genre: Garage Rock
			190 	 {
					Write-Host "$songartist - $songname was found with the following genre: $songgenre, this has been updated to: $Genre_Text_Temp" -fore yellow
					$badgenresong.genre = "Garage Rock"
				}
			# Genre: Psybient
			191 	 {
					Write-Host "$songartist - $songname was found with the following genre: $songgenre, this has been updated to: $Genre_Text_Temp" -fore yellow
					$badgenresong.genre = "Psybient"
				}
			# Default option - ie. Genre_ID not found
			Default
				{
					Write-Host "$songartist - $songname was found with the following genre: $Record.Genre_ID, this ID does not exist in GenreTable" -fore red
				}
		}
	}
}

fix-iTunes

[void][System.Runtime.InteropServices.Marshal]::ReleaseComObject([System.__ComObject]$LibrarySource) | Out-Null
[void][System.Runtime.InteropServices.Marshal]::ReleaseComObject([System.__ComObject]$iTunesApp) | Out-Null

Show what’s playing currently

#what’s playing?
$iTunes = New-Object -comObject iTunes.Application
$iTunes.CurrentTrack | select Name, AlbumArtist, Genre, Time

Mute/Unmute iTunes
$iTunes.Mute = $true
$iTunes.Mute = $false

Play/Pause/Stop iTunes playback
$iTunes.Stop()
$iTunes.Play()
$iTunes.Pause()
# toggle play/pause
$iTunes.PlayPause()

Skip to next/previous song
$iTunes.NextTrack()
$iTunes.PreviousTrack()