Written by georg
on Juli 16, 2016
Wie geht ein select-case auf der Powershell?
switch ($(hostname))
{
hosta
{
[string]$Config="hostA.example.com"
}
hostb
{
[string]$Config="hostB.example.com"
}
default
{
write-output "Script not configured for $(hostname)!"
exit 1
}
}
write-output $Config

Schreibe einen Kommentar