Reputation: 1724
I need to set two variables in a script...
The first is obviously $vmcluster - What's the proper syntax to set another variable if my "if" matches?
if ($vmname -like "LouPr*") {$vmcluster = "Production"}
Upvotes: 1
Views: 2057
Reputation: 54881
It's a script-block.... just use another line, or seperate with ;
.
if ($vmname -like "LouPr*") {
$vmcluster = "Production"
$secondvar = "secondvalue"
}
or
if ($vmname -like "LouPr*") { $vmcluster = "Production"; $secondvar = "secondvalue" }
Upvotes: 5