Get-Application and Remove-Application are deployed in Microsoft Intune as a Remediation script module. Get-Application is deployed as a Detection script and Remove-Application as a Remediation script.
In order for Remediation script to be executed Detection script should signal exit 1 as in the Intune documentation: https://learn.microsoft.com/en-us/intune/intune-service/fundamentals/remediations#script-requirements
Now, when Detection script correctly identifies application to be removed, it outputs NonCompliant and apparently just exits (perhaps exit 0?). This will result that Intune Remediation script is not run and application remains installed.
Correct functionality, when deployed in Intune, would be to output NonCompliant and signal exit 1 to initiate Remediation script to be started.
Get-Application and Remove-Application are deployed in Microsoft Intune as a Remediation script module. Get-Application is deployed as a Detection script and Remove-Application as a Remediation script.
In order for Remediation script to be executed Detection script should signal exit 1 as in the Intune documentation: https://learn.microsoft.com/en-us/intune/intune-service/fundamentals/remediations#script-requirements
Now, when Detection script correctly identifies application to be removed, it outputs NonCompliant and apparently just exits (perhaps exit 0?). This will result that Intune Remediation script is not run and application remains installed.
Correct functionality, when deployed in Intune, would be to output NonCompliant and signal exit 1 to initiate Remediation script to be started.