I've found an issue with the Variable Set function on line 158 for @CURRENTBUILD@ in the
Else section that's causing an incorrect comparison later on in the script for Windows 10 machines.
For example, setting the value of @CURRENTBUILD@ to @BUILDNUMBER@
.@UBRNUMBER@ produces:
When the expected output is:
In this example, the script later on jumps to line 243 ":VERSION1909 - Label" and compares @CURRENTBUILD@ >= 18363.1016. This should then exit the script because 18363.1256 >= 18363.1016. @CURRENTBUILD@ is instead found to be less than 18363.1016. I believe it's only comparing 18363 >= 18363.1016 because of the new-line added in line 158's variable set function.
I've corrected this by changing line 158 to Execute PowerShell with the following script, saving the output to @CURRENTBUILD@:
Code: Select all
$buildnum = (Get-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion" -Name CurrentBuildNumber).CurrentBuildNumber
$ubrnum = (Get-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion" -Name UBR).UBR
Write-Host "$buildnum.$ubrnum"
There are obviously other ways to go about fixing it but I think this needs to be corrected in the next update. It probably won't affect how Windows 10 agents are reporting hotfixes in the Patch Remedy plugin, but it has cut down on a ton of unnecessary & outdated cumulative update downloads/installs.
I'm still trying to figure out if Patch Remedy is actually benefiting my environment since most agents are Windows 10 and I've been unable to get the feature update functionality to work...