UPDATE: January 8, 2021
Windows 10 Feature Updates can be finalized by using the Automox Reboot process. All Feature Update versions released to date are supported.
As older versions of Windows 10 are retired, upgrades to newer versions of Windows 10 begin to become available through Windows Update, and you can deploy them through patch policies to your devices. Please review our best practice policy for a Feature Update Policy guide: https://support.automox.com/help/what-are-the-recommended-best-practices-for-patching-in-automox
NOTE: This is one of the few places I suggest switching on the “Install Optional and Recommended Windows Updates” option.
Automox natively handles the finalization of feature updates within the reboot functionality. That reboot could either be triggered by a policy, or from the console… in either case it send down a command to finalize the upgrade, and the device complete the upgrade as part of the process.
This Worklet will finalize Windows 10 Feature Upgrades when Automox reboots are not used. The evaluation block detects when a feature update is staged and ready to apply. The remediation block runs the upgrade finalization command.
User experience will be a hidden upgrade process, and then the device will reboot to continue with the upgrade process.
Only run this policy if upgrading to 2004 or 20H2 from a previous version.
Evaluation:
if (Test-Path $($env:SystemDrive + '\$WINDOWS.~BT\Sources')) {
# $WINDOWS.~BT is only present when a OS Upgrade is staged.
exit 1
} else {
exit 0
}
Remediation:
<#
.SYNOPSIS
Finalize Windows 10 Feature Update to version 2004 or 20H2
.DESCRIPTION
Runs finalization command to complete Windows 10 feature upgrade after staged, and complete upgrade with a reboot.
.NOTES
Author: Automox
.PREREQUISITES
Upgrade to 2004 or 20H2 must be successfully staged and ready to be applied.
#>
#Handle Exit Codes:
trap { $host.ui.WriteErrorLine($_.Exception); exit 90 }
function reboot ($isUpgrade) {
if ($isUpgrade) {
Write-Host "Finalizing OS Upgrade"
$arguments = "/Update", "/Finalize"
$patchPath = Get-ChildItem C:\WINDOWS\SoftwareDistribution -Filter WindowsUpdateBox.exe -Recurse | ForEach-Object { $_.FullName }
& "$patchPath" $arguments
}
else {
Write-Host "No Upgrade Staged"
exit 0
}
}
if (Test-Path $($env:SystemDrive + '\$WINDOWS.~BT\Sources')) {
# $WINDOWS.~BT is only present when a OS Upgrade is staged. In order for the upgrade to apply on reboot this command needs to # be executed which will finalize a bunch of settings then reboot the machine to apply the update.
reboot $true
}
else {
reboot $false
}