Assembly Version/Fully Qualified Name from the Command Line using PowerShell
I was logged into a server core installation of Windows Server 2008 and I wanted to get some details on an assembly file. But how to do it from the command line?
I found this article by good ole Scott Hanselman: Output an Assembly Version/Fully Qualified Name from the CommandLine which is great if I could have compiled the C# console program and copied it over, but I couldn’t due to various security issues. So instead I wrote the same thing in PowerShell.
It’s not particularly difficult, but it may save someone out there some time. Put this into a ps1 file:
param ( $asmFile = $(Throw "Assembly Filename is required") ) $asm = [System.Reflection.Assembly]::LoadFrom($asmFile) echo $asm.FullName
And the output is something like:
ps: .\AssemblyFullName.ps1 "Reminder.exe" Reminder, Version=18.104.22.168, Culture=neutral, PublicKeyToken=null
Tell me if you finds this helpful.