Monday, 17 November 2008

Get-AssemblyName.ps1


<#
.SYNOPSIS
Gets assembly full name of a loaded assembly
.DESCRIPTION
This script uses reflection to get and assembly, then
gets the assembly's full name
.NOTES
File Name : Get-AssemblyName.ps1
Author : Thomas Lee - tfl@psp.co.uk
Requires : PowerShell V2 CTP3
.LINK
http://pshscripts.blogspot.co.uk/2008/11/get-assemblynameps1.html
.EXAMPLE
PSH [C:\foo]: .\Get-AssemblyName.Ps1'
Full name = "mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
#>

# Start of script


# Using Reflection to get information from an Assembly:
$o =[System.Reflection.Assembly]::Load("mscorlib.dll")
$name = $o.GetName()


# Display full name
"Full name = `"{0}`"" -f $name
# End of script

No comments: