This is one of the main worker scripts that we use often. This script's primary purpose is to update a locally attached USB deployment disk with data from the deployment folders. There are several optional parameters that can be included to have the script do additional things:
This will utilize MDT's PowerShell interfaces to update the \DeploymentMedia1 folder, including updating the Windows PE WIM included in it. That WIM is used for image capture, so it is useful to keep it up to date. This takes about 20-30 minutes, depending on your system.
This will utilize MDT's PowerShell interfaces to update the boot Windows PE image for the main MDT deployment share (\DeploymentShare.ROOT). It will then expand that ISO into a cache folder. This is the boot image used to populate the MDTBOOT partition on the USB disk, so it is used often. Depending on the number of drivers being changed on it, this can take a while to complete.
This will update the DevDisk.vhdx file in \VMs with the latest bits. Be sure that a deployment disk is NOT attached via USB at the same time; behavior is unpredictable then. If the VM is running, it will be stopped automatically.
NOTE: This tool needs you to have 7-Zip installed in order to facilitate the expansion of the ISO image.