Skip to content

Instantly share code, notes, and snippets.

@WinkelCode
Last active March 29, 2024 10:21
Show Gist options
  • Save WinkelCode/b9193e091ed8bea3f729c7777c4700e2 to your computer and use it in GitHub Desktop.
Save WinkelCode/b9193e091ed8bea3f729c7777c4700e2 to your computer and use it in GitHub Desktop.
Excerpt from my Windows installation doc

Windows Installation

Creating Partitions (gdisk)

  • (Setup-dependent) Run blkdiscard or nvme format -s [1/2] -r (followed by blkdiscard) for the disk.
  • EFI:
    • Size: 100MiB
    • Type: EF00 (EFI System Partition) (Type may be optional depending on modern UEFI firmware)
  • MSR (Microsoft Reserved):
    • Size: 16MiB
    • Type: 0C01 (Microsoft Reserved Partition)
    • Always discard/zero the MSR after creation.
  • Root/OS Partition:
    • Size: ((Disk Size * 0.9) - (EFI + MSR))
    • Type: 0700 (Microsoft Basic Data)

Installing Windows (Windows ISO)

  1. Boot from the Windows installation media and press Shift + F10 to open CMD.
  2. Partition Formatting:
    • Run diskpart
    • List disks: list disk
    • Select disk: select disk [number]
    • List partitions: list partition
    • EFI Partition:
      • Select partition: select partition [number]
      • Format: format quick fs=fat32 label="EFI"
      • Assign letter: assign letter=S
    • Microsoft Reserved (MSR) Partition: No action needed.
    • Root/OS Partition:
      • Select partition: select partition [number]
      • Format: format quick fs=ntfs label="Windows"
      • Assign letter: assign letter=W
    • Creating a ReFS Volume (Optional):
      • Select partition: select partition [number]
      • Format: format quick fs=ReFS label="[label]"
      • Letter is assigned automatically.
    • Exit diskpart: exit
  3. Windows Image Deployment:
    • Assumptions:
      • E:\ is the installation medium
    1. Get Index Number of Available Editions:
      • dism /Get-WimInfo /WimFile:"E:\sources\install.wim"
    2. Apply Selected Windows Edition:
      • dism /Apply-Image /ImageFile:"E:\sources\install.wim" /index:[edition_index] /ApplyDir:W:\
    3. Install Bootloader:
      • W:\Windows\System32\bcdboot.exe "W:\Windows" /s S:
  4. Finalize Installation:
    • Shutdown the system: wpeutil shutdown
    • Ensure networking is disconnected.
    • Start PC and press F12 repeatedly for EFI binary selector.

OOBE (Out Of Box Experience)

  1. Press Shift + F10 to open CMD.
  2. Start PowerShell with Scripts/PowerShell_BypassExecPol.bat
  3. Import Group Policy: Scripts/OOBE/Import_Template_GPO.ps1
  4. Deprovision bloat apps: Scripts/OOBE/Deprovision_Bloat_Appx.ps1
  5. Run C:\Windows\System32\oobe\BypassNRO.cmd - Expect automatic restart
  6. Complete OOBE Setup:
    • Use empty (no) password.

Initial Offline Setup and Configuration

  • Set user password from Ctrl+Alt+Delete menu
@WinkelCode
Copy link
Author

WinkelCode commented Mar 29, 2024

@CodeAsm

Ow, how would one start PowerShell from within the installer environment? or just start one from the CLI ?

(I just checked back on some of my GH Gists and saw your edit)

I use Shift + F10 to pull up command prompt, then start powershell.exe.

Edit: You can also do powershell.exe -ExecutionPolicy Bypass to be able to run unsigned .ps1 scripts temporarily.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment