A number of commands are available to interact with variables:
- Clear-Variable
- Get-Variable
- New-Variable
- Remove-Variable
- Set-Variable
A number of commands are available to interact with variables:
Clear-Variable removes the value from any existing variable. Clear-Variable does not remove the variable itself. For example, the following example calls Write-Host twice: the first time it writes the variable value; the second time it does not write anything:
PS> $temporaryValue = "Some-Value"
Write-Host $temporaryValue -ForegroundColor Green
Some-Value
PS> Clear-Variable temporaryValue
Write-Host $temporaryValue -ForegroundColor Green