Fix USB creation when install.wim is read-only (#4910)

* fix: allow USB WIM splitting

* test: guard USB WIM splitting fix
This commit is contained in:
Omar
2026-08-04 16:01:12 -05:00
committed by GitHub
parent 32cc623959
commit f7c072341d
2 changed files with 13 additions and 0 deletions
+12
View File
@@ -191,6 +191,18 @@ Describe "Win11 Creator setup media" {
$confirmationIndex | Should -BeGreaterThan $guardIndex
}
It "clears install.wim read-only attribute before FAT32 splitting" {
$splitGuardIndex = $script:writeUsbFunction.IndexOf('$wimSizeMB -gt 3800')
$readOnlyResetIndex = $script:writeUsbFunction.IndexOf(
'Set-ItemProperty -LiteralPath $installWim -Name IsReadOnly -Value $false'
)
$splitCommandIndex = $script:writeUsbFunction.IndexOf('Split-WindowsImage')
$splitGuardIndex | Should -BeGreaterThan -1
$readOnlyResetIndex | Should -BeGreaterThan $splitGuardIndex
$splitCommandIndex | Should -BeGreaterThan $readOnlyResetIndex
}
It "maps Windows edition names to setup edition IDs" {
. ([scriptblock]::Create($script:editionIdFunction))