Thank you for recommending "Windows IT Pro is the leading independent community for IT professionals deploying Microsoft Windows server and client applications and technologies.".
Your recommendation has been successfully processed.
PowerShell with a Purpose Blog
by Don Jones
Demystify PowerShell, automate tedious systems administration tasks, and improve your IT efficiency with these concentrated nuggets of PowerShell goodness!
What To Do / Not to Do in PowerShell: Part 5
Posted @ 6/2/2011 10:30 AM By Don Jones
Are these variables names ones that you'd normally use?
$strComputer
$intCount
$objCustom
$arrNames
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.
$computername
$op_count
$custom
$names
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!
Related Content: