2012-12-14 2 views
1

컴퓨터 목록을 확인하고 누락 된 패치가 있는지 확인하려고합니다. 이로 인해 문제가 생길 수 있습니다. 나는 메신저가 단순한 것을 간과하지만, 도움을 주시면 감사하겠습니다.Powershell의 경우 - 문제가 없습니다.

$Comparison = get-hotfix -ComputerName $Computer | Select HotFixID 

$Comparison에서

$Computers = "TrinityTechCorp" 
$HotFixes = Get-Content HotFixes.csv 

ForEach ($Computer in $Computers) { 
    $Comparison = get-hotfix -ComputerName $Computer | Select HotFixID 
    ForEach ($HotFix in $HotFixes) { 
     IF ($Comparison -NotLike "*$HotFix*") { 
      Write-Host "$Computer missing $HotFix" 
     } 
    } 
} 
+0

어떤 문제가? 질문을 읽고 자신이 이해할 수있는 부분을 확인하십시오 – manojlds

답변

4

HotFixId 특성을 가진 개체를 수집 할 것이다. 당신은 문자열의 집합으로 그들을 원하는 경우

, 당신은 할 필요가 :

$Comparison = get-hotfix -ComputerName $Computer | Select -expand HotFixID 
+0

고맙습니다. – user1451070