- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
switch also has a -regex flag:
$vms = Get-Cluster | Get-VM
Foreach($vm in $vms) {
$vmview = $vm | get-view
switch -Regex ($vmview.Summary.Config.GuestFullName) {
"Windows" {"Windows"}
"Linux" {"Linux"}
"CentOS" {"CentOS"}
default {"Other"}
}
}
Tags I haven't worked with.