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, Publ
While you can't create some sort of namespace alias per se, you can use the following trick (taken from Lee Holmes' PowerShell Cookbook):
$namespace = "System.Windows.Forms.{0}"
$form = New-Object ($namespace -f "Form")
But that only will work with New-Object
since that takes a string for the class name. You can't use that syntax with a type name in square brackets.
What you can do, however, is leave out the System
part which is implied:
[Windows.Forms.MessageBox]::Show("Hello World!")
Makes it slightly shorter.