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

  • Home
  • SEARCH
  • 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 7959033
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T04:30:36+00:00 2026-06-04T04:30:36+00:00

In C# I can use the method Console.Error.WriteLine . This doesn’t work in Powershell,

  • 0

In C# I can use the method Console.Error.WriteLine. This doesn’t work in Powershell, instead I must write

[Console]::Error.WriteLine

Why square brackets, why the double colons?

ps. To be clear, I’m not interested in logging, I want to understand the syntax about types and objects and methods

  • 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-04T04:30:37+00:00Added an answer on June 4, 2026 at 4:30 am

    Brackets = access to a type

    double colons = access to a static member of a type : [MyType] return a Type instance

    ex:

    c:> [System.Int32]

    IsPublic IsSerial Name BaseType

    ——– ——– —- ——–

    True True Int32 System.ValueType

    using the dot notation would only give you access to instance members of the Type instance (reflection related methods for most)…

    c:\> [System.Int32].Parse("3")
    
    Method call failed because [System.Runtype] does not have any "Parse" member
    
    c:\> [System.Int32].AssemblyQualifiedName
    
    System.Int32, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
    

    so :: is the way to access static members of a Class

    c:\> [System.Int32]::Parse("3")
    3
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there a standard method I can use in place of this custom method?
In Python I can use get method to get value from an dictionary without
Ok I know you can use the dir() method to list everything in a
In Python I can use the iterkeys() method to iterate over the keys of
Using PHP's Image and GD functions you can use the following method to finally
Can I use a native method which returns a pointer? I used the following
I know I can use the ActionView helper strip_tags method in my views to
In my language I can use a class variable in my method when the
I have an extension method which I can use from the .cs codebehind of
To create a delegate from a method you can use the compile type-safe syntax:

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.