Thursday, 4 December 2014


This function 'measures' (counts) the number of
Type Accelerators on your system.
This function counts the number of type accelerators are
on your systems and returns that number.
File Name : Measure-TypeAccelerator.ps1
Author : Thomas Lee -
Requires : Version 3
Script Repository
Psh[C:\foo]> Measure-TypeAccelerator.ps1
Psh[C:\foo]> Count-TypeAccelerator.ps1


Function Measure-TypeAccelerator {
# Define parameters and enable advanced functions
# NB no parameters!
Param ()

# Start of function
Write-Verbose 'Getting acount of all Type Accelerators'
$Count = (([PSObject].Assembly.GetType('System.Management.Automation.TypeAccelerators')::Get).GetEnumerator() |
Write-Verbose "$Count Type Accelerators found on $(hostname)"
Return $count

# Set an alias
Set-Alias CTA Measure-TypeAccelerator
Set-Alias MTA Measure-TypeAccelerator

No comments: