The Windows Assessment and Deployment Kit (Windows ADK) supplies tools for assessing and deploying Windows. Automation commonly reaches it indirectly: oscdimg creates a Windows ISO containing Autounattend.XML, but the kit must be installed separately because it is not included with Windows. section 10.4
Make automation resilient by locating the required executable rather than assuming a fixed installation path:
- Search the Windows Uninstall registry keys to confirm that the Windows ADK is installed. section 10.4.1
- Read KitsRoot10 from the Windows Kits Installed Roots registry key when the uninstall entry does not provide an installation directory. section 10.4.1
- Fall back to an efficient, tiered filesystem search across standard directories and eligible volumes when registry lookup fails. section 10.4.1
$Path = 'HKLM:\SOFTWARE\WOW6432Node\Microsoft\Windows Kits\Installed Roots' $DevTools = Get-ItemProperty -Path $Path $DevTools.KitsRoot10
Use the KitsRoot10 registry value to retrieve the Windows Kits installation root before searching broader locations. section 10.4.1
Locating oscdimg.exe
A PowerShell automation can add the KitsRoot10 path first, then include Program Files, Program Files (x86), ProgramData, and local application data as search roots. It can inspect non-removable, lettered volumes while excluding temporary storage, then search for oscdimg.exe before invoking it. section 10.4.1
