OSD: Install dynamic software

In addition to a fixed list, applications and packages can also be installed dynamically. For example, applications assigned to the primary user or separately assigned applications or packages of the device can be installed without having to maintain a fixed list in the task sequence.
For this purpose, I have created a script that reads the following things during the runtime of the task sequence:
- Primary user and their assigned applications and application groups
- Applications, application groups and packages of the device
You can find the script here: https://github.com/SirConfigMgr/MEMCM_Toolbox/blob/main/Invoke-DynamicAppInstall.ps1
The first step is to create a package with the script as content. You do not need a program.
Within the task sequence, the process consists of four steps:
Run PowerShell Script
The script from the package that reads the applications is executed here.
Select the package and insert the name of the script.
Insert the parameters:
-SiteCode "SiteCode" -SiteServer "Server.FQDN" -ResourceName %_SMSTSMachineName% -LogPath "C:\Windows\CCM\Logs" -UserApps True -MachineApps True
Change SiteCode and SiteServer matching your environment.
ResourceName can remain as it is.
You can change the LogPath or leave it a it is.
If UserApps is True, the user applications are read out in the script. If not, they are skipped.
If MachineApps is True, the user applications are read out in the script. If not, they are skipped.

Install Application (User)
The dynamically compiled list of the user’s applications is installed here.
Base variable name: AppID

Add the condition under Options.
Variable: SkipUserApplications

Install Application (Machine)
The dynamically compiled list of applications for the device is installed here.
Base variable name: M_AppID

Add the condition under Options.
Variable: SkipMachineApplications

Install Package (Machine)
The dynamically compiled list of packages for the device is installed here.
Base variable name: M_PackageID

Add the condition under Options.
Variable: SkipMachinePackages

Logging
The script logs all applications found under the specified path.
User applications can be found in the log SMSTS_DynamicAppInstall4User.log and device applications can be found in the log SMSTS_DynamicAppInstall4Machine.log.