The Uninstall-ADK function silently uninstalls the ADK component that is specified.
The Find-InstalledProgramInfo function searches the registry path "HKLM:\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall" to determine if certain programs are installed or properties of installed programs (e.g., version number, uninstall string, etc.).
This commit introduces the Confirm-ADKVersionIsLatest function to check if the currently installed version of the ADK is the latest available version from Microsoft.
This commit introduces two new functions, Get-ADKURL and Install-ADK, to facilitate the retrieval and installation of the Windows Assessment and Deployment Kit (ADK) components.
The Get-ADKURL function retrieves the download URL for the specified ADK option (either "Windows ADK" or "WinPE Add-on") from the official Microsoft documentation page. It utilizes web scraping to extract the URL dynamically.
The Install-ADK function downloads the specified ADK component from the obtained URL and installs it silently on the system. It handles errors gracefully and cleans up the temporary installation file after completion.
These functions enhance the automation capabilities of the project by simplifying the process of acquiring and installing ADK components required for Windows deployment and assessment tasks.
This commit refactors the BuildFFUVM.ps1 script by:
- Changing the default value of FFUDevelopmentPath to $PSScriptRoot
- Adding a new parameter RemoveFFU
- Adding a new function Remove-FFU to remove all FFU files in the FFUCaptureLocation
- Adding a conditional block to call Remove-FFU if RemoveFFU parameter is true
When using -installapps $false when capturing a FFU, a Critical Process Died BSOD would happen when deploying the FFU and Windows attempted to load.
When capturing the FFU, the registry is loaded to grab the Windows version information to create the FFU file name. After unloading the registry, the FFU is captured. This process can happen too fast on certain hard drives (NVME). A 15 second delay was added after the unloading of the registry to allow for the process to complete before the FFU is captured.
Included some better error handling if defining optionalfeatures that require source folders (netfx3). ESD files don't have source folders like ISO media, which means installing .net 3.5 as an optional feature would fail. Also cleaned up some formatting.
Optimize-FFU is broken due to the Recovery partition not having a name. dism checks for the presence of a name for each partition and if it doesn't have one, optimize-FFU breaks. The fix is in the ffuprovider.dll in the 25255 branch, which is in the Insider ADK. The public release for that isn't coming soon, and using the Insider ADK requires test signing/test mode to be turned on and secureboot disabled. This causes issues with systems that have virtualization-based security. Due to this, changing the code back to not creating a recovery partition while building the FFU, and creating the recovery partition during deployment and then letting Windows copy in and configure WinRE after. Later this year, whenever the ADK gets released, I'll update the script to revert this behavior.