PowerShell with a Purpose Blog

What To Do / Not to Do in PowerShell: Part 5

Are these variables names ones that you'd normally use?


If so, you probably have a pretty strong background in VBScript. That style of variable naming is called Hungarian Notation, and it was widely used - and even recommended by Microsoft - for years in the VBScript world.

We've moved on.

Typically, it's not crucial - especially in PowerShell - to remember that a variable contains a string, which is what the "str" prefix is supposed to include. Instead, it's more important to know that the variable contains, say, a computer name - which you'd know in your head is a string. Removing those type prefixes can make variable names easier to read, too.


Hungarian notation is no longer considered a "best practice" by the world in general, or by the broader PowerShell community. So lose the prefix, and stick with straightforward, self-explanatory variable names from here on out!

Hide comments


  • Allowed HTML tags: <em> <strong> <blockquote> <br> <p>

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.