mirror of
https://github.com/ntdevlabs/tiny11builder.git
synced 2025-03-13 18:15:30 +00:00
Improve image index input validation in tiny11maker.ps1
- Added validation to ensure the entered index is valid by checking against available indices in the Windows image file. - Introduced a loop to repeatedly prompt the user until a valid index is provided.
This commit is contained in:
parent
d37e3e1b01
commit
0241e51814
@ -87,7 +87,13 @@ Start-Sleep -Seconds 2
|
||||
Clear-Host
|
||||
Write-Host "Getting image information:"
|
||||
Get-WindowsImage -ImagePath $ScratchDisk\tiny11\sources\install.wim
|
||||
$index = Read-Host "Please enter the image index"
|
||||
|
||||
$index = Read-Host "Please enter the image index : "
|
||||
$ImagesIndex = (Get-WindowsImage -ImagePath $ScratchDisk\tiny11\sources\install.wim).ImageIndex
|
||||
while ($ImagesIndex -notcontains $index) {
|
||||
$index = Read-Host "Please enter a valide image index : "
|
||||
}
|
||||
|
||||
Write-Host "Mounting Windows image. This may take a while."
|
||||
$wimFilePath = "$ScratchDisk\tiny11\sources\install.wim"
|
||||
& takeown "/F" $wimFilePath
|
||||
|
Loading…
Reference in New Issue
Block a user