Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8551419
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T14:11:29+00:00 2026-06-11T14:11:29+00:00

In PowerShell, you can specify a type with square brackets like so: PS C:\Users\zippy>

  • 0

In PowerShell, you can specify a type with square brackets like so:

PS C:\Users\zippy> [int]

IsPublic IsSerial Name                                     BaseType
-------- -------- ----                                     --------
True     True     Int32                                    System.ValueType

There are also built in type accelerators like [xml] which saves a few keystrokes when you wish to cast something to an XmlDocument.

PS C:\Users\zippy> [xml]

IsPublic IsSerial Name                                     BaseType
-------- -------- ----                                     --------
True     False    XmlDocument                              System.Xml.XmlNode

You can generate the list via one of the two commands:

  • PS v2.0 [type]::gettype("System.Management.Automation.TypeAccelerators")::Get
  • PS v3.0 [psobject].assembly.gettype("System.Management.Automation.TypeAccelerators")::Get

PowerShell 3.0 adds an operator called [ordered]. Its not a type alias though.

PS C:\Users\zippy> [ordered]
Unable to find type [ordered]: make sure that the assembly containing this type is loaded.
At line:1 char:1
+ [ordered]
+ ~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (ordered:TypeName) [], RuntimeException
    + FullyQualifiedErrorId : TypeNotFound

However, it can cast Hashtables to OrderedDictionarys.

PS C:\Users\zippy> ([ordered]@{}).GetType()

IsPublic IsSerial Name                                     BaseType
-------- -------- ----                                     --------
True     True     OrderedDictionary                        System.Object

So my question is, if [ordered] is not a type accelerator, what is it?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T14:11:30+00:00Added an answer on June 11, 2026 at 2:11 pm

    Unfortunately [ordered] is a bit of an aberration. It’s neither a type nor an accelerator. It only exists in the parser and is treated as a hint on how to create a hashtable (i.e. don’t use hashtable, use ordereddictionary instead.) Think of it as a .net attribute, except it’s not 😀

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I can display a simple Visual Basic inputbox from a PowerShell script like this:
How can I make Powershell behave like Bash with its flag set -e ?
I define a custom PowerShell type with New-Object. I would like a parameter to
In PowerShell you can use pushd (an alias for Push-Location ) and popd (an
Can I run PowerShell scripts in an Silverlight application?
How can I get my PowerShell script to print the info in tabular format
Can someone give me a Powershell script that will change the format of all
In PowerShell, how can I test if a variable holds a numeric value? Currently,
How can I encode the Unicode character U+0048 (H), say, in a PowerShell string?
When I call a Powershell script, how can I keep the called script from

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.