I’m using this DSC script as part of an automated (packer) OS build:
My issue is that when I run:
Start-DscConfiguration -Path ConfigName -Wait -Force -Verbose
…the DSC fires successfully, it triggers the download / install of the patches (e.g. the latest 1GB CU for Windows 2016) - but then the Start-DscConfiguration immediately returns - leaving the patch to download/install in the background.
The issue being that my build then assumes that the process is complete, the node is compliant and continues to shut the machine down for templating.
Question is - is there an amendment I can make to the logic of the script to not exit until the patches are installed, or if not, is there a reliable way to continually check for compliance, and not move on until compliance is met?