Advertisement
Sinisterly

Old Hotfix Comparison Method

Jul 30th, 2015
380
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.     $totalhflist = @()
  2.         foreach ($node in $nodes)
  3.         {
  4.             Write-Verbose ("" + (TS) + "Getting hotfix info for $node")
  5.             Get-Hotfix -ComputerName $node | % {
  6.                 $hfitem = "" | Select Node, HotfixID
  7.                 $hfitem.Node = $node
  8.                 $hfitem.HotfixID = $_.HotfixID
  9.                 $totalhflist += $hfitem
  10.             }
  11.         }
  12.         $allhfnames = $totalhflist.HotfixId | Sort-Object -Unique
  13.         $hfdiscrepancylist = @()
  14.         Write-Verbose ("" + (TS) + "Generating Hotfix Comparison Report for $Cluster")
  15.         foreach ($hf in $allhfnames)
  16.         {
  17.             if (($totalhflist | ? {$_.HotfixID -eq $hf}).count -ne $nodes.count)
  18.             {
  19.                 $hfditem = "" | Select HotfixID
  20.                 $hfditem.HotfixID = $hf
  21.                 foreach ($node in $nodes)
  22.                 {
  23.                     $hfditem | Add-Member -NotePropertyName $node -NotePropertyValue ([boolean]($totalhflist | ? {$_.Node -eq $Node -and $_.hotfixID -eq $hf}))
  24.                 }
  25.                 $hfdiscrepancylist += $hfditem
  26.             }
  27.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement