Ugly Stool Rotating Header Image

December, 2009:

Media Information with PowerShell

This trick only works if you have Microsoft Expression Encoder installed, and PowerShell.  Load the Encoder assembly, construct a new MediaItem, and pass the first file in the directory ((dir)[0].FullName) as the constructor argument.

[System.Reflection.Assembly]::LoadWithPartialName("Microsoft.Expression.Encoder")
$media = New-Object -TypeName Microsoft.Expression.Encoder.MediaItem (dir)[0].FullName

After creating the object, you can look at all the properties easily, or look at specific ones.

$media
$media.FileType
$media.MaxBitRate
$media.VideoSize

Page optimized by WP Minify WordPress Plugin