My Software Notes

Useful things I discover

Assembly Version/Fully Qualified Name from the Command Line using PowerShell

with 2 comments

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=2.1.2.1, Culture=neutral, PublicKeyToken=null

Tell me if you finds this helpful.

Advertisements

Written by gsdwriter

July 12, 2010 at 1:06 pm

Posted in Tools

2 Responses

Subscribe to comments with RSS.

  1. Thanks, this is really useful.

    Actually, I’ve done it in a bit different way (but anyway, inspired by your idea):
    1. Run PowerShell
    2. Type
    $asm = [System.Reflection.Assembly]::LoadFrom(“”)
    3. Type
    echo $asm.FullName

    Nikita G.

    September 28, 2010 at 7:05 am

    • Glad I could help.

      gsdwriter

      September 28, 2010 at 1:16 pm


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: