
Mastering Windows PowerShell Scripting (Second Edition)
By :

A number of commands are available to interact with variables:
Clear-Variable
Get-Variable
New-Variable
Remove-Variable
Set-Variable
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
Get-Variable
provides access to any variable that has been created in the current session as well as the default (automatic) variables created by PowerShell. For further information on automatic variables, see about_Automatic_Variables
(Get-Help about_Automatic_Variables
).
When using the *-Variable
commands, the $
preceding the variable name is not considered part of the name.
Default...
Change the font size
Change margin width
Change background colour