$ErrorActionPreference = 'Continue' $d = 'C:\PF\TEST_i' $fake = Join-Path $d 'Data.pf' $base = 'C:\PF\USBInstaller\test\fake' $log = Join-Path $d 'fake-build.log' $done = Join-Path $d 'fake-done.txt' Remove-Item $done -Force -ErrorAction SilentlyContinue "=== start $(Get-Date -Format 'HH:mm:ss')" | Out-File $log -Encoding UTF8 if (Test-Path $fake) { Remove-Item $fake -Force } if (Test-Path $base) { Remove-Item $base -Recurse -Force -ErrorAction SilentlyContinue } foreach ($i in 1, 2, 3) { New-Item -ItemType Directory -Path (Join-Path $base "$i") | Out-Null } # image 1: 128 MB + 2 GB; image 2: 30 MB (32 MB partition!); image 3: 512 MB $files = @( @{ dir = '1'; name = 'data1.bin'; mb = 128 }, @{ dir = '1'; name = 'big1.bin'; mb = 2048 }, @{ dir = '2'; name = 'data2.bin'; mb = 30 }, @{ dir = '3'; name = 'data3.bin'; mb = 512 }, @{ dir = '3'; name = 'big3.bin'; mb = 2048 } ) foreach ($f in $files) { $path = Join-Path $base ($f.dir + '\' + $f.name) fsutil file createnew "$path" ([int64]$f.mb * 1MB) | Out-Null "made $($f.dir)/$($f.name): $($f.mb) MB" | Out-File $log -Append -Encoding UTF8 } # markers (same paths as in the real build) New-Item -ItemType Directory -Path (Join-Path $base '1\efi\Paravis\Boot') -Force | Out-Null "PARAVIS FLASH - test marker (efi)" | Out-File (Join-Path $base '1\efi\Paravis\Boot\NOT.DEL') -Encoding ASCII New-Item -ItemType Directory -Path (Join-Path $base '3\ISO\Ventoy') -Force | Out-Null "PARAVIS FLASH - test marker (ISO)" | Out-File (Join-Path $base '3\ISO\Ventoy\NOT.DEL') -Encoding ASCII & dism.exe /Capture-Image /ImageFile:"$fake" /CaptureDir:"$base\1" /Name:"1-PARAVIS" /Description:"TEST 2 GB" /Compress:none 2>&1 | Out-File $log -Append -Encoding UTF8 & dism.exe /Append-Image /ImageFile:"$fake" /CaptureDir:"$base\2" /Name:"2-VTOYEFI" /Description:"TEST 2 GB" 2>&1 | Out-File $log -Append -Encoding UTF8 & dism.exe /Append-Image /ImageFile:"$fake" /CaptureDir:"$base\3" /Name:"3-DATA" /Description:"TEST 512 MB" 2>&1 | Out-File $log -Append -Encoding UTF8 & dism.exe /Get-WimInfo /WimFile:"$fake" 2>&1 | Out-File $log -Append -Encoding UTF8 Remove-Item $base -Recurse -Force -ErrorAction SilentlyContinue if (Test-Path $fake) { $len = (Get-Item $fake).Length "OK $len" | Out-File $done -Encoding UTF8 } else { "FAIL" | Out-File $done -Encoding UTF8 } "=== end $(Get-Date -Format 'HH:mm:ss')" | Out-File $log -Append -Encoding UTF8