Need your support to get the patch information on a server.
I have seen examples of Get-Hotfix and did Get-Member options to find information about the patch release date and i couldn’t find. The WMI QuickfixEngineering also has no info.
I don’t need when the patch was installed, but a decent update like what was installed when with respect to the released patch.
So, i went here https://support.microsoft.com/en-us/help/4009470/windows-8-1-windows-server-2012-r2-update-history , took all the information in the left side and made a simple file.
Something that looked like this…
I am not good at extracting data out of web-pages so i did the above file manually and placed it at a central location accessible.
I need some help to simplify the below code.
#Patch sources https://support.microsoft.com/en-us/help/4009470/windows-8-1-windows-server-2012-r2-update-history
$patch2k12R2 = ‘’
$resultPatches = ‘’
#get the patches MS had released from repository, my local file maintained.
$patch2k12R2 = Invoke-WebRequest -uri “http://myrepository/win2k12r2.file”
#$patch2k12R2.Content -> to See the output of the file.
#get hotfixes installed on the local server.
$HotfixIDLast = Get-HotFix | sort-object -Descending | select -expandproperty HotfixID
foreach($HotfixIDLastOne in $HotfixIDLast)
if(($patch2k12R2.Content| findstr $HotfixIDLastOne ))
$resultPatches += ($patch2k12R2.Content| findstr $HotfixIDLastOne).toString() +“`n”
$resultPatches.Split(“`n”)| select -First 1
My worst fears would be that i am missing something obvious which is available already instead of this…
Any directions would be helpful.
Thank you for your time…