Hey!
Recently I got and a mission to inventory the ServicepackMajorversion on our servers. So ive made a script that you can use in a CI if you want.
Discovery Script
function Get-ServicePackMajorVersion { [CmdletBinding()] param () Begin { } Process { Try { # Get Operating System Info $sOS =Get-WmiObject -class Win32_OperatingSystem -computername Localhost foreach($sProperty in $sOS) {} ForEach-Object { If($sProperty.ServicePackMajorVersion -match "0") { $State = 0} ElseIf($sProperty.ServicePackMajorVersion -match "1") { $State = 1} } } catch { # Error hantering } $state } End { } } Get-ServicePackMajorVersion
Compliance Rule
Equals 1 ( which is “a Service pack is installed”)
Good luck!
/Pontus