Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I need to compare the installed patches between a dev and production environment using PowerShell. How can I do this?

share|improve this question

1 Answer 1

up vote 8 down vote accepted

I recently blogged about this problem and came up with this script. You can either run it as a user that is administrator on both machines, or use the -Credential option on the get-hotfix commands.

$server1 = Read-Host "Server 1"
$server2 = Read-Host "Server 2"

$server1Patches = get-hotfix -computer $server1 | Where-Object {$_.HotFixID -ne "File 1"}

$server2Patches = get-hotfix -computer $server2 | Where-Object {$_.HotFixID -ne "File 1"}

Compare-Object ($server1Patches) ($server2Patches) -Property HotFixID
share|improve this answer
Never knew about get-hotfix. Great nugget of information there. –  Mike Nov 13 '12 at 17:27
Be careful when using Get-Hotfix, it only reports a subset of patches. See this Hey Scripting Guy article for more information. @Mike –  Ashley Steel Mar 3 '14 at 18:12

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.