Export (0) Print
Expand All
Collapse the table of content
Expand the table of content
Expand Minimize

Converting VBScript's Assignment Operator

Windows PowerShell

Definition: Assigns a value to a variable or property.

Assignment Operator

Assigning a value to a variable is no big deal in Windows PowerShell: you put the variable on the left side of the equation, the value to be assigned on the right side, and an equals sign (=) smack dab in the middle. For example, this command assigns the string value test to the variable $a:

$a = "test"

And this command assigns the sum of the numbers 1, 2, and 3 to $a:

$a = 1 + 2 + 3

Return to the VBScript to Windows PowerShell home page

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
© 2015 Microsoft