PowerShell - Set Alias for Loaded Assembly

Posted by Uros Calakovic on Stack Overflow See other posts from Stack Overflow or by Uros Calakovic
Published on 2010-03-27T12:10:53Z Indexed on 2010/03/27 12:13 UTC
Read the original article Hit count: 522

Filed under:
|
|

I use this code to load a .Net assembly to PowerShell:

[System.Reflection.Assembly]::Load("System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089") | out-null

[System.Windows.Forms.MessageBox]::Show("Hello world")

Can I set an alias for an assembly (for example 'System.Windows.Forms' = 'Forms') so that I don't have to type the assembly full name when calling static methods like MessageBox.Show()?

© Stack Overflow or respective owner

Related posts about powershell

Related posts about load-assembly