PowerTip: Multiply Value in Variable and Store Results


Summary: Use Windows PowerShell to multiply the value stored in a variable and store the results.

Hey, Scripting Guy! Question How can I use Windows PowerShell to multiply the value of a variable and store the results in the same variable?

Hey, Scripting Guy! Answer Use the *= operator, for example:

PS C:\> $a = 2

PS C:\> $a *= 3

PS C:\> $a

6

Comments (0)

Skip to main content