Here are some simple examples:
This command simply converts a folder full of FLAC files into Lame MP3s:
Get-AudioFile *.flac | Export-AudioFile "Lame MP3" -Directory C:\Output
To list all the available encoders:
Get-AudioEncoderInfo
To get the available settings, default settings etc. for Lame:
Get-AudioEncoderInfo "Lame MP3"
All the available cmdlets are documented, so for examples and a list of parameters, use the Get-Help cmdlet:
Get-Help Export-AudioFile -Full
Here are some more advanced examples, which illustrate some of my favorite use cases:
Add ReplayGain 2.0 to your entire FLAC library, treating each directory as a separate album:
Get-ChildItem C:\Users\Myself\Music -Directory -Recurse | % { $_ | Get-ChildItem -File -Filter *.flac | Measure-AudioFile "ReplayGain 2.0"
-PassThru | Save-AudioFileMetadata }
Convert your whole FLAC library to VBR AAC, with SoundCheck tags calculated from album ReplayGain information:
Get-ChildItem C:\Users\Myself\Music -Filter *.flac -Recurse | Get-AudioFile | Export-AudioFile "Apple AAC" "C:\Output\{Artist}\{Album}" -Setting @{AddSoundCheck = "Album"} -Name "{TrackNumber} - {Title}"
Convert your whole FLAC library to VBR MP3, with ReplayGain directly applied to the resulting volume levels:
Get-ChildItem C:\Users\Myself\Music -Filter *.flac -Recurse | Get-AudioFile | Export-AudioFile "Lame MP3" "C:\Output\{Artist}\{Album}" -Setting @{ApplyGain = "Album"} -Name "{TrackNumber} - {Title}"
Hope this helps! PowerShell is really wonderful, once you get used to an object-oriented shell.