February 2019
Intermediate to advanced
626 pages
15h 51m
English
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 GreenSome-ValuePS> Clear-Variable temporaryValuePS> Write-Host $temporaryValue -ForegroundColor Green
Read now
Unlock full access