Clean Windows 11 Pro install and setup for my notebook. Plain scripts, no dotfile manager.
install/
autounattend.xml hands-off Windows install except the disk page (EN UI, US + SK QWERTY keyboard, local account BB)
firstlogon.ps1 run once by autounattend: regional settings, then debloat.ps1
debloat.ps1 removes junk apps, turns off Copilot/Recall/widgets/ads, dev settings - rerun after big updates
apps.ps1 installs apps (winget, Scoop for standalone CLI tools, PS modules), enables Hyper-V - rerun any time
devdrive.ps1 optional: creates a Dev Drive for projects
config/ settings to copy by hand (PowerShell profile, Office)
- Back up to the NAS everything on C: you want to keep (Desktop, Downloads, Documents,
C:\Projects,%USERPROFILE%\.claude,.ssh,.gitconfig, VS Code profile export). C: is the only data partition and gets deleted - open a few of the copied files on the NAS before you reboot into the installer. - Know your partitions.
autounattend.xmlnever touches the disk - setup stops at the disk page and you pick (see Install). Note the layout in the current Windows:Unplug every other USB drive (backup disks, card readers) before booting the installer - only the install stick may be connected, so the disk page shows just the NVMe and the stick.Get-Partition -DiskNumber 0 | Sort-Object Offset | Format-Table PartitionNumber, DriveLetter, Type, @{n='GB';e={[math]::Round($_.Size/1GB,1)}}
- The ZBook's NVMe runs on the standard Windows NVMe driver (Intel VMD is off), so setup sees the disk without extra drivers. Leave VMD off in the BIOS; if you ever turn it on, setup needs the HP Intel RST/VMD driver (put it in a
$WinPEDriver$folder in the USB root).
- Download the Windows 11 26H2 ISO (or Media Creation Tool) from microsoft.com, English (United States), x64.
- Write it to a USB stick (8 GB+).
- Copy this whole repository to the USB root, then copy
install\autounattend.xmlto the USB root as well:E:\autounattend.xml E:\install\firstlogon.ps1 E:\install\debloat.ps1 E:\install\apps.ps1 ...
-
Boot from the USB (F9 boot menu on HP). Keep the stick plugged in until the desktop appears. Setup stops once, at "Select location to install Windows 11" (Disk 0 = the 1.9 TB KIOXIA):
- Leave alone: System (~0.5 GB), MSR (~0.1 GB), Recovery (~1 GB, maybe two).
- Select the old Windows partition (~1.9 TB) → Delete.
- Select the Unallocated space it leaves → Next. Setup creates the partition and reuses the existing System and Recovery ones.
- On a new, empty SSD: just select the unallocated disk → Next.
From there it runs on its own, offline (no Wi-Fi page):
- removes the junk apps from the image before the first profile exists (log:
C:\Windows\Temp\bb-debloat-system.log) - creates local account BB with an empty password, logs in once and runs
firstlogon.ps1: English (World) formats, home location Czech Republic, US + Slovak QWERTY keyboard, thendebloat.ps1(log:C:\Windows\Temp\bb-firstlogon.log)
If the installer ignores the answer file (asks for language, product key or edition), pick Previous version of Setup on its first screen.
-
Check before going further (a reinstall is cheap now, painful later):
C:\Windows\Temp\bb-firstlogon.logshowsDeviceRegion = 75. That is the EEA region (Edge uninstallable, DMA choices) and only a reset can change it.- Activation: Settings → System → Activation says active (HP firmware Pro key). If not, in an admin shell:
slmgr /ipk <key>with the key from(Get-CimInstance SoftwareLicensingService).OA3xOriginalProductKey.
-
Set a password / PIN right away (Settings → Accounts → Sign-in options). Then connect Wi-Fi.
-
Windows Update until nothing is left, including Advanced options → Optional updates (HP drivers and firmware come this way too). Then rerun
debloat.ps1(see below) - some apps can arrive with updates. -
install\apps.ps1in a normal (not admin) PowerShell - Scoop refuses to install as admin. Restart afterwards (Hyper-V). Then HP drivers, BIOS and firmware with HP Image Assistant (installed byapps.ps1; no HP Support Assistant needed). On AC power, in an admin shell:C:\SWSetup\HPImageAssistant\HPImageAssistant.exe /Operation:Analyze /Action:Install /Selection:All /Category:Drivers,BIOS,Firmware /Silent /ReportFolder:C:\Temp\HPIA
Restart afterwards. Rerun every 2-3 months (
winget upgrade HP.ImageAssistantfirst). -
Python and Node through their managers:
uv python install,fnm install --lts. -
Office: get
setup.exefrom the Office Deployment Tool (microsoft.com), thensetup.exe /configure config\office\office.xml. Sign in to OneDrive and Teams. -
BitLocker. First check WinRE in an admin shell:
reagentc /infomust say Enabled, with a location on a Recovery partition (...\partitionN\Recovery\WindowsRE, N not the C: partition). Then Control Panel → BitLocker Drive Encryption → Turn on, and save the recovery key in Vaultwarden. -
New SSH key (don't copy the old one), add it to the agent and GitHub:
ssh-keygen -t ed25519 ssh-add $HOME\.ssh\id_ed25519 gh ssh-key add $HOME\.ssh\id_ed25519.pub
-
Copy settings from
config/(PowerShell profile →$PROFILE). Set the terminal font to JetBrainsMono Nerd Font (Windows Terminal → Settings → Defaults → Appearance) so starship and Terminal-Icons show icons. -
Optional:
install\devdrive.ps1(admin) for a Dev Drive, then keep projects on it.
If apps or ads come back, run (as admin):
powershell -ExecutionPolicy Bypass -File .\install\debloat.ps1