Forum Discussion
robmo
Apr 08, 2024Brass Contributor
Intune Win32 app detection method
Hi, I am attempting to create an Intune Win32 App package that will apply a custom theme to our computers. custom.theme and lockscreen.jpg get copied to C:\Windows\Resources\Themes. A folder na...
- Apr 09, 2024You should have something that writes to STDOUT; you can use Write-Output with the text you write to the log file... Detections work with something STDOUT and an Exit 0 for detected or Exit 1 (or higher) for not detected and start the installation.
You should have something that writes to STDOUT; you can use Write-Output with the text you write to the log file... Detections work with something STDOUT and an Exit 0 for detected or Exit 1 (or higher) for not detected and start the installation.
robmo
Apr 09, 2024Brass Contributor
Is this what you are suggesting?
if($compliant -eq 0) {
Add-Content -Path $logFile -Value "Installation is compliant"
Write-Output "Installation is compliant"
Exit 0
} else {
Add-Content -Path $logFile -Value "Installation is not compliant"
Write-Output "Installation is not compliant"
Exit 1
}
- Apr 09, 2024Yes, that should be it. One Write-Output for Intune with the Exit code and one for your log (the detection script output is also visible in your Intune logs in c: program data, perhaps redundant?).
- robmoApr 09, 2024Brass ContributorThe logging was really about debugging. If I'm confident this is working properly, I would be comfortable with removing the logging feature.
- Apr 09, 2024I always use Start-Transcript c:\temp\xyz.log at the top of the script (xyz is an example) and Stop-Transcript at the end. That way, you see the script's output like you would when running it in a console.