Contact Info

Crumbtrail

ActiveXperts.com » Administration » Powershell » Powershell 4.0 » New-Variable

New-Variable - Powershell 4.0 CmdLet

ActiveXperts Network Monitor ships with integrated Powershell scripts to monitor complex network. The scripts run out of the box
Download the ActiveXperts Network Monitor FREE version now »

New-Variable

Short description
Creates a new variable.

Syntax


Description
The New-Variable cmdlet creates a new variable in Windows PowerShell. You can assign a value to the variable while 
creating it or assign or change the value after it is created.


You can use the parameters of New-Variable to set the properties of the variable (such as those that create read-only 
or constant variables), set the scope of a variable, and determine whether variables are public or private.


Typically, you create a new variable by typing the variable name and its value, such as "$var = 3", but you can use 
the New-Variable cmdlet to use its parameters.