thaapavuori
asked on
powershell and if statement
I have made this kind of PS script. What is wrong with it?
Depending of variable $type I would like to set value of variable $value. What is wrong with this and how I could correct it?
$type = Read-Host "Write the type"
if ($type -eq 1) {$value -eq "A"}
elseif ($type -eq 2) {$value -eq "B"}
elseif ($type -eq 3) {$value -eq "C"}
else {"You typed incorrectly"}
Kind regards,
Timo
Depending of variable $type I would like to set value of variable $value. What is wrong with this and how I could correct it?
$type = Read-Host "Write the type"
if ($type -eq 1) {$value -eq "A"}
elseif ($type -eq 2) {$value -eq "B"}
elseif ($type -eq 3) {$value -eq "C"}
else {"You typed incorrectly"}
Kind regards,
Timo
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Open in new window