- <#
- .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 accelerators contained in PowerShell
- .NOTES
- Additional Notes, eg
- File Name : Get-TypeAccelerator.ps1
- Author : Thomas Lee - tfl@psp.co.uk
- Requires : Version 2, CTP3
- .LINK
- Original article:
- http://www.nivot.org/2008/12/25/ListOfTypeAcceleratorsForPowerShellCTP3.aspx
- Script Repository
- http://www.pshscripts.blogspot.com
- #>
- ###
- # Start of script
- ###
- ([type]::GetType("System.Management.Automation.TypeAccelerators"))::Get.GetEnumerator() |
- Select @{Name="Name"; expression={$_.key}},
- @{name="Type"; expression={$_.value}} | Sort name | Format-Table -Autosize
- # End of script
This script produces the following output:
PS C:\foo> .\Get-TypeAccelerator.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


0 comments:
Post a Comment