Validate Win32 app detection rules and generate a custom detection PowerShell script that reports
"app detected" only when every rule condition holds. Rule types, required fields and character restrictions follow the official documentation.
Advertisement
The detection contract (custom script)
Exit code
STDOUT
How Intune reads it
0
non-empty
Detected (app is considered installed)
0
no output
Not detected (app is considered absent)
non-zero
—
Error (detection failed, deployment does not continue)
The default script timeout is 60 seconds; exceeding it counts as a detection failure. Avoid heavy work such as enumerating all of Win32_Product.
Rules per type (official)
At least one rule is required — you cannot deploy with zero rules
Multiple rules are ANDed — all rule conditions must be satisfied for the app to be detected (there is no OR)
MSI — matched by product code (GUID); can only be added once, product version check optional
File / folder — the Path must not contain certain special characters such as , or ", which break detection
Registry — key path must be HKEY_LOCAL_MACHINE\… / HKLM\…; an empty value name detects the key itself
On 64-bit clients, 32-bit paths and registry keys are redirected — account for Program Files (x86) and Wow6432Node
When the app is not detected, a required-intent app is re-offered within about 24 hours