Deferral Help - how to act on the defer in code before exiting

Is there any place in the code I can catch a deferral before it exits?

So user clicks the defer button and I want to do some custom code before exit… how/where would I be able to do that.

and bonus points if anyone has code to set a scheduled task to make sure the deferral pops up daily since sccms isint great at that

Using PSADT 3.8.4

I’ve not seen any code that specifically catches the deferral, however, if you can capture either Exit Code:

  • 1618 - Exit code used when a UI prompt times out or the user opts to defer.
  • 60012 - Exit code used when a user opts to defer.

(Source: AppDeployToolkit\AppDeployToolkitConfig.xml)

This would handled in the Show-InstallationWelcome function (from ~ line 8640 in AppDeployToolkit\AppDeployToolkitMain.ps1)

I vaguely remember there was an extension that another poster had written to give the user more control over the deferal, i.e. gave the user a date & time when they would like the installation deferred to. It looked quite a good addition to the Toolkit.
However, I can’t remember exactly, But I think it had some functional issues, and I think the OP of this other thread went quiet, so the issues never got fixed. I also believe I saw recently that someone was hoping this feature / change to the deferral process might get included in v4.0 of the toolkit :crossed_fingers:.

FYI: v3.9.3 is currently the latest version of the Toolkit - There are quite a few bug fixes since v3.8.4, so it might be worth giving that a try and see if this gives you some further options
Release Notes:

1 Like