switch
в PowerShell похож на менее запутанный оператор if
elseif
, но else
не работает. Что еще я могу сделать?
switch ("test") {
"1" {"2"}
"2" {"1"}
} else {"other"}
выдает ошибку
else : The term 'else' is not recognized as the name of a cmdlet, function, script file, or operable program. Check
the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:4 char:3
+ } else {"other"}
+ ~~~~
+ CategoryInfo : ObjectNotFound: (else:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException