In order to use a detection mechanism for verifying if a specific patch is installed a reg key can be used. ( HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Component Based Servicing\Packages )
However a WMI class Win32_Quickfixengineering also exists
This class contains all the installed patches :
So now you can create a query in order to verify if a specific patch has been installed and use this as a condition for example in a task sequence or as a detection mechanisme for a specific patch.
Select * from Win32_QuickFixengineering where HotFixId='< Enter your KB number here>’
Quick Tip ! Verify state of Windows updates / hotfixes