PowerTip: Use PowerShell to Determine ASCII Value

PowerTip: Use PowerShell to Determine ASCII Value

  • Comments 3
  • Likes

Summary: Learn to use Windows PowerShell to determine the ASCII numeric value of a character.

Hey, Scripting Guy! Question How can I use Windows PowerShell to tell the ASCII value of a character?

Hey, Scripting Guy! Answer You can get the numeric value of an ASCII character quite easily, for example,
           to get the value of the lowercase letter a, type:

[byte][char]'a'

Your comment has been posted.   Close
Thank you, your comment requires moderation so it may take a while to appear.   Close
Leave a Comment
  • thank you

  • Strictly speaking, you're getting the Unicode value of a character here, not Ascii. That happens to match Ascii for the common US-English stuff (0-127), but beyond that, you'll get different results.