Introduction
Assignment operators let you store or update values in variables easily.
$variable = value $variable += value $variable -= value $variable *= value $variable /= value $variable %= value
$count = 10$count += 5$name = "John" $name += " Doe"
$score = 20 $score += 10 $score -= 5 $message = "Hello" $message += ", World!" Write-Output "Score: $score" Write-Output "Message: $message"
+= operator do in PowerShell?+=+= operator adds the value on the right to the current value of the variable.+= means add and assign [OK]$x by 5 and update it in PowerShell?*= multiplies the variable by the right value and updates it.$x *= 5, which is the correct syntax for multiplication assignment.*= for multiply and assign [OK]$count = 10 $count -= 3 $count += 2 Write-Output $count
$count -= 3 subtracts 3, so $count becomes 7.$count += 2 adds 2, updating $count to 9.$value = 8 $value +== 2 Write-Output $value
+== is not valid in PowerShell; the correct operator for addition assignment is +=.+== -> Option A+=, not +== [OK]"World" to variable $greeting which initially holds "Hello ". Which PowerShell statement correctly updates $greeting using an assignment operator?+= adds the right string to the existing string variable.$greeting += "World", which appends "World" to "Hello ".+= to append strings [OK]Pass the test and this pattern moves unknown