ODE -value 1 -option constant
Set-Variable -name NOT_COMPLIANT_CODE -value 0 -option constant

# Deregisters a UE-V template
function UnregisterTemplate
{
    $complanceResult = $NOT_COMPLIANT_CODE

    try
    {
        $templateObj = [wmi] 'root\Microsoft\UEV:SettingsLocationTemplate="%%UEVTEMPLATEID%%"'
        $templateObj.Unregister()
        $complanceResult = $COMPLIANT_CODE
    }
    catch
    {
        $complanceResult = $NOT_COMPLIANT_CODE
        Write-Host $error[0]
    }

    return $complanceResult
}

$result = UnregisterTemplate
Write-Output $result
