Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我需要在脚本中设置两个变量...
第一个显然是 $vmcluster - 如果我的“if”匹配,设置另一个变量的正确语法是什么?
if ($vmname -like "LouPr*") {$vmcluster = "Production"}
这是一个脚本块....只需使用另一行,或与;.
;
if ($vmname -like "LouPr*") { $vmcluster = "Production" $secondvar = "secondvalue" }
或者
if ($vmname -like "LouPr*") { $vmcluster = "Production"; $secondvar = "secondvalue" }