$null = $AdapterBandPreference
$Adapter = "Wi-Fi"
$AdapterProperty = "Preferred Band"
$DisplayValue = "2. Prefer 2.4GHz band"

Try {
    $AdapterBandPreference = Get-NetAdapterAdvancedProperty -Name $Adapter -DisplayName $AdapterProperty
    If ($AdapterBandPreference.DisplayValue -eq $DisplayValue){
        Write-Output "Compliant"
        Exit 0
    } 
    Write-Warning "Not Compliant"
    Exit 1
} 
Catch {
    Write-Warning "Not Compliant"
    Exit 1
}