PowerTip: Find a List of PowerShell Type Accelerators

Summary: Use Windows PowerShell to list type accelerators.

Hey, Scripting Guy! Question How can I find a list of type accelerators available in Windows PowerShell?

Hey, Scripting Guy! Answer Use the Get property from TypeAccelerators class:


Comments (8)

  1. Boe Prox says:

    @Burt Harris
    There isn’t a type accelerator for that. You would have to do this in order to get a type accelerator available.

    $accelerator = [PSObject].Assembly.GetType(‘System.Management.Automation.TypeAccelerators’)
    $null = $accelerator::Add(‘accelerator’,$accelerator)

  2. Burt Harris says:

    Wouldn’t a shorter version be: [accelerators]::Get

  3. David Eisner says:

    According to this very blog (http://blogs.technet.com/b/heyscriptingguy/archive/2013/07/08/use-powershell-to-find-powershell-type-accelerators.aspx),
    it was at one point possible to use [accelerators]::get, as @Burt Harris suggested:

    "But Windows PowerShell 3.0 also introduces a type accelerator for type accelerators. Yep, and it is very easy to use. Here is the command: [accelerators]::get …"

    What ever became of that?

  4. MaxFLipz says:

    @David, that’s part of the PowerShell Community Extensions.

  5. BPK says:

    Please is [DateTime] really an accelerator? Been having a long series of non agreeing correspondences with some senior script geeks who are saying it is not. I’m getting somewhat confused by all the jargons. If it is an accelerator for the .Net Framework
    System.DateTime, why unlike Get-Date does it fail to convert dd-MM-yyyy strings when the day value is >12 even those culture datetimeformat has been customized to the format?

  6. Jontu Kontar says:

    I’ve been looking at Accelerators and attempting to figure out which ones are available for my use in PowerShell Scripts… Thus far, it seems as though the list you can generate by this method is incomplete.

    Specifically: Why aren’t [TimeZoneInfo] or [DateTimeOffset] on this list? What process would I use to find them?

Skip to main content