PowerShell: Variable
Variable name starts with a dollar sign $
Variable names are case-insensitive.
Variable name can contain space or unicode.
Use {}
to quote them, like this:
${odd var name}
Create Variable
$x = 3
Variable can store output of a command
$x = dir
Clear Variable
Set it to $null
or use Clear-Variable
$x = $null
Clear-Variable $x
clv
is alias of Clear-Variable
.
Delete Variable
Remove-Item -Path Variable:\varName
rm -Path variable:\x
rm
is alias of Remove-Item
.
List Variables
dir variable:
here's part of the output:
