A number of commands are available to interact with the following variables:
- Clear
- Get
- New
- Remove
- Set
When using the * variable commands, the $ preceding the variable name isn't considered part of the name.
A number of commands are available to interact with the following variables:
When using the * variable commands, the $ preceding the variable name isn't considered part of the name.
The Clear variable removes the value from any existing variable. It does not remove the variable itself. For example, the following example calls Write-Host twice: on the first occasion, it writes the variable value; on the second occasion, it does not write anything:
PS> $temporaryValue = "Some-Value"
PS> Write-Host $temporaryValue -ForegroundColor Green
Some-Value
PS> Clear-Variable temporaryValue
PS> Write-Host $temporaryValue -ForegroundColor Green