private/Test-IsWindows1125H2.ps1

function Test-IsWindows1125H2 {
    <#
    .SYNOPSIS
        Tests whether the operating system is Windows 11 build 26200
 
    .DESCRIPTION
        Queries Win32_OperatingSystem through CIM and checks that Caption
        contains Windows 11 and BuildNumber equals 26200. Returns $false when
        CIM data is unavailable or either value does not match.
 
    .EXAMPLE
        PS> Test-IsWindows1125H2
 
        Tests whether the current operating system is Windows 11 build 26200.
 
    .INPUTS
        None. This function does not accept pipeline input.
 
    .OUTPUTS
        System.Boolean. Returns $true for Windows 11 build 26200; otherwise,
        returns $false.
 
    .NOTES
        Author: David Segura
        Company: Recast Software
        Version: 1.0.0
        Date: 2026-08-28
 
        The build check compares the BuildNumber string and does not inspect
        the update revision.
    #>

    [OutputType([bool])]
    param ()

    $os = Get-CimInstance -ClassName Win32_OperatingSystem -ErrorAction SilentlyContinue
    return ($null -ne $os -and $os.Caption -like '*Windows 11*' -and $os.BuildNumber -eq '26200')
}