Scripting Games 2008 Sudden Death Challenge 5
My Solution for sudden dead event 5 of the 2008 scripting games :
$l = [collections.arraylist][char[]]"ABCDEFGHIJKLMNOPQRSTUVWXY"
$Properties = @()
gwmi -list |% {([wmiclass]$_.name).properties} |
where {$_.origin -like "win32_*"} |
select name,origin |
foreach {
if ($l.Contains($_.name[0])) {$Properties += $_;$l.remove($_.name[0])}
}
$properties | sort name
A funny one I tought of later :
(gwmi -list |% {([wmiclass]$_.name).properties} |
where {$_.origin -like "win32_*"} |
select name,origin | sort -unique {$_.name[0]})[0..24]
Enjoy,
Greetings /\/\o\/\/