Tom Hearn over at was working with SharePoint and needed to get at the Public Key Token from various assemblies to be added to the Safe Assembly list in the SharePoint configuration.  He posted the code for a Cmdlet that would, given the path to an assembly, extract the Public Key Token and output it to the console.

I, being too lazy to get out my C# compiler, decided to test it out with a script function.  Here’s what I came up with: