12-28-2008
Downloads: 326
File size: 2.4kB
Views: 1,479
Embed
 |
Gets type accelerators in CTP3 |
- <
- .SYNOPSIS
- Gets a list of Type Accelerators in PowerShell and displays them nicely
- .DESCRIPTION
- This script is based on Osin's blog article and uses the TypeAccelerator
- class to return the type accellerators contained in PowerShell
- .NOTES
- Additional Notes, eg
- File Name : get-typeaccelerator.ps1
- Author : Thomas Lee - tfl@psp.co.uk
- Requres : Version 2, CTP3
- .LINK
- Original article:
- http://www.nivot.org/2008/12/25/ListOfTypeAcceleratorsForPowerShellCTP3.aspx
- Script Repository
- http://www.pshscripts.blogspot.com
- .EXAMPLE
- PS C:\foo> .\get-typeaccelerators.ps1
-
- Name Type
- ---- ----
- adsi System.DirectoryServices.DirectoryEntry
- adsisearcher System.DirectoryServices.DirectorySearcher
- array System.Array
- bool System.Boolean
- byte System.Byte
- char System.Char
- decimal System.Decimal
- double System.Double
- float System.Single
- hashtable System.Collections.Hashtable
- int System.Int32
- ipaddress System.Net.IPAddress
- long System.Int64
- powershell System.Management.Automation.PowerShell
- pscustomobject System.Management.Automation.PSObject
- psmoduleinfo System.Management.Automation.PSModuleInfo
- psobject System.Management.Automation.PSObject
- ref System.Management.Automation.PSReference
- regex System.Text.RegularExpressions.Regex
- runspace System.Management.Automation.Runspaces.Runspace
- runspacefactory System.Management.Automation.Runspaces.RunspaceFactory
- scriptblock System.Management.Automation.ScriptBlock
- single System.Single
- string System.String
- switch System.Management.Automation.SwitchParameter
- type System.Type
- wmi System.Management.ManagementObject
- wmiclass System.Management.ManagementClass
- wmisearcher System.Management.ManagementObjectSearcher
- xml System.Xml.XmlDocument
- .EXAMPLE
- PS C:\foo> Get-Help .\get-typeaccelerators.ps1 -full
- Left as an exercise for the reader.
-
-
-
-
-
-
-
-
- ([type]::gettype("System.Management.Automation.TypeAccelerators"))::Get.getenumerator() |
- select @{Name="Name"; expression={$_.key}},
- @{name="Type"; expression={$_.value}} | sort name | format-table -autosize
-
This script uses soem cool CTP3 features to print out the currently implemented type accelearators and what they point to. NB: You can add type accelerators (a subject for a separate post!)