Detect-AppHealth.ps1

<#PSScriptInfo
.VERSION 1.0
.GUID a3c7f2d1-5b9e-4c0f-9e88-4f1b7c2d9a44
.AUTHOR Mert Efe Kanlikilic
.DESCRIPTION A detection script that evaluates application health status on Intune-managed Windows devices.
#>


$path = CProgram Files7-Zip7z.exe

try {
    if (!(Test-Path $path)) {
        Write-Output 7-Zip binary missing
        exit 1
    }


    Write-Output 7-Zip healthy
    exit 0
}
catch {
    Write-Output Detection error $_
    exit 1
}