Many of these scripts were originally located in https://gist.github.com/flcdrg. Newer versions will live here so they can be better version controlled.
- Deactivate any licensed software that is linked to the machine (eg. Red Gate)
- Shutdown any VMs
- Ensure that Bitlocker recovery keys are all backed up.
https://schneegans.de/windows/unattend-generator/
Includes assumption that C: is partition 3 of disk 0
eg.
DISKPART> list part
Partition ### Type Size Offset
------------- ---------------- ------- -------
Partition 1 System 100 MB 1024 KB
Partition 2 Reserved 16 MB 101 MB
Partition 3 Primary 1168 GB 117 MB
- post-install.ps1 - Things to run after Windows installation (run with elevated permissions)
- post-install-nonadmin.ps1 - Things to run after Windows installation (run with non-elevated permissions)
- Set-Touchpad.ps1 - Disable single tap to click with Touchpad
https://learn.microsoft.com/en-us/windows/dev-drive/#storing-package-cache-on-dev-drive
Copy to $Env:LOCALAPPDATA\Packages\Microsoft.WindowsTerminal_8wekyb3d8bbwe\LocalState\settings.json
Windows schedule tasks:
Prerequisites:
mkdir oldMedia\Ge\client_professional_en-usAnd download Windows ISO, mount and copy files into that directory.
mkdir packages\CUDownload latest cumulative update(s) and put in this directory
mkdir packages\DeployDriverPackDownload latest driver pack and put in this directory, then run to to extract all files.
.\packages\DeployDriverPack\XPS-15-9530-VV12J_Win11_1.0_A12.exe /s /e=D:\git\reinstall-windows\packages\DeployDriverPackCreate the following directories:
mkdir packages\Other\SafeOSDynamic
mkdir packages\Other\SetupDynamic
mkdir packages\OtherDriversMostly these can be ignored as now Microsoft are releasing new ISOs each month with all patches.
(From elevated)
Export-WindowsDriver -Online -Destination D:\git\reinstall-windows\packages\OtherDrivers\Use the most recent version of each. There isn't always a new release every month.
Download the latest x64 files
The cumulative update may include a servicing stack update. You'll need to refer to the support article to figure out which file is the CU and which is the SSU. If it doesn't, then just point to the same msu
.NET Cumulative updates
- Go to https://learn.microsoft.com/en-us/dotnet/framework/release-notes/release-notes
- Select latest cumulative update
- Click on link under Summary tables to go to the support article, making sure it applies to your Windows release.
- Under How to get this update, locate the Microsoft Update Catalog row and click on the link
- Save files to
packages\Other
Create a subdirectory for each additional driver from hardware vendor or Microsoft Update Catalog. (Use the UpdateID for a constant URL) and save .cab file or actual driver files. Cab will be automatically extracted by script.
From elevated prompt:
Mount ISO -
Mount-DiskImage -ImagePath D:\git\reinstall-windows\en-us_windows_11_consumer_editions_version_25h2_updated_march_2026_x64_dvd_a1cf6c36.isoCopy entire contents of ISO to D:\git\reinstall-windows\oldMedia\Ge\client_professional_en-us\
Remove existing install.wim
rm .\oldMedia\Ge\client_professional_en-us\sources\install.wimExtract just Windows 11 Pro image from ISO to local
Export-WindowsImage -SourceImagePath G:\sources\install.wim -SourceIndex 6 -DestinationImagePath oldMedia\Ge\client_professional_en-us\sources\install.wim -CompressionType maxUnmount ISO
Ensure that Windows images are mounted on an NTFS volume (not ReFS/DevDrive), otherwise you'll get weird file access errors
Copy autounattend.xml to USB Suspend Bitlocker Reboot machine Press F12 to bring up boot menu Select USB drive (second volume?)
After setup completes, run these scripts in order from an elevated PowerShell prompt:
Run these scripts from a non-elevated PowerShell prompt: