@aescolastico wrote an amazing Windows 10 feature update script and kindly shared it with us a while back. Here is the link to his solution:Worklet: Automox OS Upgrade to Latest Windows10 OS version
One of our customers was presented with a content download issue. Their devices were all in their offices, and all contain the same OS (same SKU, Language, architecture).
@aescolastico’s solution does a fantastic job of determining what iso to download… due to this specific scenario, they preferred to download once, and use that ISO specifically for upgrades.
With the environment and OS specifics already determined, I turned @aescolastico’s Ferrari of a script into a Moped to reduce the needed internet bandwidth and download time. A highbred of the two scripts is quite possible (example, check OS specs and download if it doesn’t match one you’ve placed in a local repository).
Anywho, here it is . How to use a Worklet to upgrade Windows 10 from a local network share:
<#
.SYNOPSIS
This script will attempt to copy an iso from a network share to a local directory, mount the iso, and run a Windows 10 upgrade command.
.DESCRIPTION
This script may not work on all systems. Modify to fit your needs.
Please test locally and ensure the script runs as intended before automating deployments.
.NOTES
File Name :UpgradeWin10fromISOonNetwork.ps1
Author :Automox
Prerequisite :OS and iso must match in architecture, SKU, and language. Script assumes device objects (system) has access to the share, and that the share is accessible when Worklet runs.
.LINK
http://www.automox.com
#>
############# Change the settings in this block #######################
$networkPath = '\\YOUR_SERVER\FOLDER\Windows10.iso'
$isoPath = 'C:\Windows\Temp\Windows10.iso'
$logPath = 'C:\windows\Temp'
#######################################################################
#Copy iso from network to temp directory
If(Test-Path -Path $networkPath){
Write-Output "Attempting to copy $networkPath to $isoPath"
Copy-Item -Path $networkPath -Destination $isoPath -Force
} else {
throw "$networkPath is not accessible"
}
#Mount iso
if (Test-Path $isoPath) {
$driveLetter = (Mount-DiskImage -ImagePath $isoPath | Get-Volume).DriveLetter
$driveLetter = (Get-DiskImage -ImagePath $isoPath | Get-Volume).DriveLetter
Write-Output "ISO Mounted to $driveLetter during attempt 1"
if (!$DriveLetter){
Mount-DiskImage -ImagePath $isoPath -StorageType ISO
Write-Output "ISO Mounted to $driveLetter attempt2"
}
} else {
throw "ISO could not be found at $isoPath"
}
If (-not( $driveLetter)){
throw "ISO could not be mounted"
}
#Launch Upgrade
Write-Output "The Upgrade will commence shortly. Your PC will be rebooted soon. Please save any work you do not want to lose."
#
if ($driveLetter) {
Invoke-Expression "$($driveLetter):\setup.exe /auto Upgrade /quiet /Compat IgnoreWarning /DynamicUpdate disable /copylogs $logPath"
} else {
throw "Mapped drive letter did not exist and Setup.exe was not run"
}