Hi Members,
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 Windows 8.1 and Windows Server 2012 R2 update history , took all the information in the left side and made a simple file.
Something that looked like this…
<hr />
15-Jan-19 KB4480969
8-Jan-19 KB4480964
8-Jan-19 KB4480963
11-Dec-18 KB4471322
11-Dec-18 KB4471320
27-Nov-18 KB4467695
13-Nov-18 KB4467703
13-Nov-18 KB4467697
18-Oct-18 KB4462
<hr />
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 HotfixIDif($patch2k12R2)
{
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…
V