Exploring Type Accelerators

by Mar 13, 2017

PowerShell uses a number of so-called type accelerators that help with long .NET type names. Instead of using “System.DirectoryServices.DirectoryEntry”, for example, you can simply type “ADSI”.

When you query the property FullName of a type, you always get back the underlying full .NET type name:

PS C:\> [ADSI].FullName

PS C:\>

And this line dumps all the built-in .NET type accelerators in PowerShell:

[PSObject].Assembly.GetType("System.Management.Automation.TypeAccelerators")::get |

Aside from the explicit type accelerators, there is another rule built into PowerShell: when a type resides in the namespace “System”, then you can always omit this namespace. This is why all of these are the same:

PS C:\> [int].FullName

PS C:\> [System.Int32].FullName

PS C:\> [Int32].FullName

Twitter This Tip! ReTweet this Tip!