Thursday, February 21, 2008

2008 Scripting Games!! Beg. Event 2

My Powershell solution for Event 2. Its a bit different than MOW's solution (The things Marc does is mind boggling!!)
   1:  $key = Get-Item 'HKLM:\Software\Microsoft\Windows NT\CurrentVersion\Fonts'
   2:  foreach ($subkeyname in $key.property) {
   3:      if ($subkeyname.contains("TrueType")) { 
   4:          $subkeyname 
   5:          $truetype++
   6:      }
   7:  }
   8:  ""
   9:  "TrueType: $truetype"
  10:  "Total: " + $key.Property.Length

This was pretty straight forward and really doesnt need much explaining. Simply getting the key as an array and parsing through it looking for "TrueType" in the name with the Foreach statement.

No comments: