INTRODUCTION

If you are trying to do a script based installation of several hotfixes, you will most likely see that the script will fail if the hotfix is already installed.

SOLUTION

Here is a way of solving it, so only hotfixes that are not installed will be applied.

$source = "c:\temp" #Source folder $KBArrayList = New-Object -TypeName System.Collections.ArrayList $KBArrayList.AddRange(@("KB2775511""KB2533623","KB2639308","KB2670838","KB2729094","KB2731771","KB2786081","KB2834140","KB2882822","KB2888049","")) foreach ($KB in $KBArrayList) { if (-not(Get-Hotfix -Id $KB)) { Start-Process -FilePath "wusa.exe" -ArgumentList "$source\$KB.msu /quiet /norestart" -Wait } } 

REFERENCES

RELATED POSTS