Automating the world one-liner at a time…
PSMDTAG:FAQ: What is a TYPE SHORTCUT?PSMDTAG:FAQ: What are the TYPE SHORTCUTS?
Type shortcuts are a Windows PowerShell feature that allows you to reduce the amount of typing you have to do when specifying a type.
For example, the following 2 statements produce the same result:
[System.Text.RegularExpressions.Regex]"^c.*"
[Regex]"^c.*"
Jim Truher produced the following list of type shortcuts available in V1.0 (NOTE: The WMI ones will be available in RC2 as noted in: http://blogs.msdn.com/powershell/archive/2006/06/26/647038.aspx )
[int] typeof(int) [int[]] typeof(int[]) [long] typeof(long) [long[]] typeof(long[]) [string] typeof(string) [string[]] typeof(string[]) [char] typeof(char) [char[]] typeof(char[]) [bool] typeof(bool) [bool[]] typeof(bool[]) [byte] typeof(byte) [double] typeof(double) [decimal] typeof(decimal) [float] typeof(float)[single] typeof(float)[regex] typeof(System.Text.RegularExpressions.Regex)[array] typeof(System.Array)[xml] typeof(System.Xml.XmlDocument)[scriptblock] typeof(System.Management.Automation.ScriptBlock)[switch] typeof(System.Management.Automation.SwitchParameter)[hashtable] typeof(System.Collections.Hashtable)[type] typeof(System.Type)[ref] typeof(System.Management.Automation.PSReference)[psobject] typeof(System.Management.Automation.PSObject)[wmi] typeof(System.Management.ManagementObject)[wmisearcher] typeof(System.Management.ManagementObjectSearcher)[wmiclass] typeof(System.Management.ManagementClass)
Jeffrey Snover [MSFT]Windows PowerShell/Aspen ArchitectVisit the Windows PowerShell Team blog at: http://blogs.msdn.com/PowerShellVisit the Windows PowerShell ScriptCenter at: http://www.microsoft.com/technet/scriptcenter/hubs/msh.mspx
PSMTAG:DOTNET: Language shortcuts for type specifications
PSMTAG:LANGUAGE: Language shortcuts for type specifications
[void] also seems to exists as of RC2 or so.
Anyone know of a way to discover these programatically? Or is it embedded too deep?
This script might do it (Gets type accelerators in CTP3): http://powershell.com/cs/media/p/691.aspx