Output list of scripts contained in a management pack

I was perusing my library of powershell scripts today and stumbled across this neat little gem. I do not recall writing it, so probably cannot take the credit. But I wanted to post it here in case anyone else can make use of it.

If the original author is here, please raise your hand!

$xml = New-Object “System.Xml.XmlDocument”
$xml.Load(“path to management pack xml”)
$scripts = $xml.SelectNodes(“descendant::ScriptName”)
$scripts | group “#text” | select name | sort name

Comments welcome (links require moderation)