Add Descriptions to Variables

by Nov 5, 2008

Keeping track of a variable’s purpose can be accomplished by assigning a clear text description:

$ip = '10.10.10.10'

Set-Variable ip -description 'Server IP or Name'

When you now list your variables, you can output the variable description as well:

dir variable:ip | Format-Table Name, Value, Description