This page looks best with JavaScript enabled

Use PowerShell to spell names, passwords etc!

 ·  β˜• 4 min read  ·  ✍️ Javy de Koning

We frequently need to spell out names, ticket ID’s or other complex “words” over the phone. We also frequently deal with some special characters in passwords and so-on. If you don’t often practice this, quickly spelling-out over the phone might be difficult. To counter this issue I’ve decided to create a simple PowerShell function for people to put into their profile for easy access. It works like this:

1Get-NatoSpelling 'MyP@$sw0rd_!$_c00l'

Result:

1'MyP@$sw0rd_!$_c00l': capital-mike, yankee, capital-papa, at-sign, dollar-sign, sierra, whiskey, zero, romeo, delta, underscore, exclamation-point, dollar-sign, underscore, charlie, zero, zero, lima

You can put the function below it in your profile for easy access. Enjoy!

  1Function Get-NatoSpelling {
  2  param
  3  (
  4      [string]$string
  5  )
  6  
  7  [string]$output
  8  for ($i = 0; $i -lt $string.length; $i++)
  9  {
 10    switch -CaseSensitive ($string[$i]) 
 11    {
 12      'A' {$output += 'ALFA, '}
 13      'B' {$output += 'BRAVO, '}
 14      'C' {$output += 'CHARLIE, '}
 15      'D' {$output += 'DELTA, '}
 16      'E' {$output += 'ECHO, '}
 17      'F' {$output += 'FOXTROT, '}
 18      'G' {$output += 'GOLF, '}
 19      'H' {$output += 'HOTEL, '}
 20      'I' {$output += 'INDIA, '}
 21      'J' {$output += 'JULIET, '}
 22      'K' {$output += 'KILO, '}
 23      'L' {$output += 'LIMA, '}
 24      'M' {$output += 'MIKE, '}
 25      'N' {$output += 'NOVEMBER, '}
 26      'O' {$output += 'OSCAR, '}
 27      'P' {$output += 'PAPA, '}
 28      'Q' {$output += 'QUEBEC, '}
 29      'R' {$output += 'ROMEO, '}
 30      'S' {$output += 'SIERRA, '}
 31      'T' {$output += 'TANGO, '}
 32      'U' {$output += 'UNIFORM, '}
 33      'V' {$output += 'VICTOR, '}
 34      'W' {$output += 'WHISKEY, '}
 35      'X' {$output += 'X-RAY, '}
 36      'Y' {$output += 'YANKEE, '}
 37      'Z' {$output += 'ZULU, '}
 38      'a' {$output += 'alfa, '}
 39      'b' {$output += 'bravo, '}
 40      'c' {$output += 'charlie, '}
 41      'd' {$output += 'delta, '}
 42      'e' {$output += 'echo, '}
 43      'f' {$output += 'foxtrot, '}
 44      'g' {$output += 'golf, '}
 45      'h' {$output += 'hotel, '}
 46      'i' {$output += 'india, '}
 47      'j' {$output += 'juliet, '}
 48      'k' {$output += 'kilo, '}
 49      'l' {$output += 'lima, '}
 50      'm' {$output += 'mike, '}
 51      'n' {$output += 'november, '}
 52      'o' {$output += 'oscar, '}
 53      'p' {$output += 'papa, '}
 54      'q' {$output += 'quebec, '}
 55      'r' {$output += 'romeo, '}
 56      's' {$output += 'sierra, '}
 57      't' {$output += 'tango, '}
 58      'u' {$output += 'uniform, '}
 59      'v' {$output += 'victor, '}
 60      'w' {$output += 'whiskey, '}
 61      'x' {$output += 'x-ray, '}
 62      'y' {$output += 'yankee, '}
 63      'z' {$output += 'zulu, '}
 64      '0' {$output += 'Zero, '}
 65      '1' {$output += 'One, '}
 66      '2' {$output += 'Two, '}
 67      '3' {$output += 'Tree, '}
 68      '4' {$output += 'Four, '}
 69      '5' {$output += 'Five, '}
 70      '6' {$output += 'Six, '}
 71      '7' {$output += 'Seven, '}
 72      '8' {$output += 'Eight, '}
 73      '9' {$output += 'Nine, '}
 74      '/' {$output += 'Forward-slash, '}
 75      '\' {$output += 'Back-slash, '}
 76      '$' {$output += 'Dollar-Sign, '}
 77      '*' {$output += 'Star-Sign, '}
 78      '?' {$output += 'Question-mark, '}
 79      '!' {$output += 'Exclamation-point, '}
 80      '@' {$output += 'AT-sign, '}
 81      '#' {$output += 'Number-sign, '}
 82      '&' {$output += 'Ampersand, '}
 83      '(' {$output += 'Opening-Parentheses, '}
 84      ')' {$output += 'Closing-Parentheses, '}
 85      '[' {$output += 'Opening-brackets, '}
 86      ']' {$output += 'Closing-brackets, '}
 87      '{' {$output += 'Opening-braces, '}
 88      '}' {$output += 'Closing-braces, '}
 89      ';' {$output += 'Semi-colon, '}
 90      ':' {$output += 'Colon, '}
 91      '>' {$output += 'Greater-than-sign, '}
 92      '<' {$output += 'Lesser-than-sign, '}
 93      '-' {$output += 'Dash, '}
 94      '_' {$output += 'Underscore, '}
 95      '.' {$output += 'Dot, '}
 96      ',' {$output += 'Comma, '}
 97      '+' {$output += 'Plus-sign, '}
 98      '=' {$output += 'Equals-sign, '}
 99    } 
100  }
101  return $output 
102}
103Export-ModuleMember Get-*

Javy de Koning
WRITTEN BY
Javy de Koning
Geek πŸ€“, Love sports πŸƒβ€β™‚οΈπŸ‹οΈβ€β™‚οΈ, Food πŸ›, Tech πŸ’», @Amsterdam ❌❌❌.