MSEndpointMgr / IntuneWin32App

Provides a set of functions to manage all aspects of Win32 apps in Microsoft Intune.
MIT License
345 stars 88 forks source link

Suggestion: Allow override of default return codes for Add-IntuneWin32App #99

Open gwinhoven opened 1 year ago

gwinhoven commented 1 year ago

It would be handy to be able to overring the default return codes when using Add-IntuneWin32App. This would allow adding custom post install behavior for the default codes.

Currently, you can use New-IntuneWin32AppReturnCode to build the custom return code behaviors with the default codes. But when you add them during Add-IntuneWin32App it will accept it and add doubles of the return code behavior. The app will be created, but when you view it in the portal, it throws errors saying "Return code is already used".

image

I haven't tested deploying an app with the duplicate return codes, but I'm assuming it would break trying to handle two different behaviors for one code.

Maybe add a check during the handling for the -ReturnCode behavior. If one of the objects set for that parameter is 0, 1707, 3010, 1641, or 1618 don't add it to the Win32 app as part of the default return codes.

NickolajA commented 1 year ago

That makes total sense. Seems to be a bug to me. Let me fix it.