|
|
@ -794,7 +794,7 @@ function ShowGetISOPath { |
|
|
|
$ISOFiles = [ordered]@{} |
|
|
|
$ISOFiles = [ordered]@{} |
|
|
|
$Index = 0; |
|
|
|
$Index = 0; |
|
|
|
try { |
|
|
|
try { |
|
|
|
Get-ChildItem -Path $Path -Include '*.iso' -Recurse -File | ForEach-Object { |
|
|
|
Get-ChildItem -Path $Path -Include '*.iso' -Recurse -File -ErrorAction SilentlyContinue | ForEach-Object { |
|
|
|
$Index = $Index + 1 |
|
|
|
$Index = $Index + 1 |
|
|
|
$ISOFiles.Add([System.String]$Index, $_.FullName) |
|
|
|
$ISOFiles.Add([System.String]$Index, $_.FullName) |
|
|
|
} |
|
|
|
} |
|
|
@ -954,7 +954,37 @@ function UpdateVentoyConfig { |
|
|
|
[System.IO.File]::WriteAllLines($VentoyConfigJsonPath, $JSONString, $Utf8NoBomEncoding) |
|
|
|
[System.IO.File]::WriteAllLines($VentoyConfigJsonPath, $JSONString, $Utf8NoBomEncoding) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
$VersionInfo = 'v2022.6.11' |
|
|
|
function GetVertion { |
|
|
|
|
|
|
|
$ProductJsonPath = "$PSScriptRoot\product.json" |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!(Test-Path -Path $ProductJsonPath -PathType Leaf)) { |
|
|
|
|
|
|
|
Write-Warning -Message ("$ProductJsonPath 不存在") |
|
|
|
|
|
|
|
[System.Environment]::Exit(0) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$ProductInfo = $null |
|
|
|
|
|
|
|
try { |
|
|
|
|
|
|
|
$ProductInfo = Get-Content -Path $ProductJsonPath | ConvertFrom-Json |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
catch { |
|
|
|
|
|
|
|
Write-Warning -Message ("$ProductJsonPath 解析失败") |
|
|
|
|
|
|
|
[System.Environment]::Exit(0) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (!$ProductInfo -or $ProductInfo -isNot [PSCustomObject]) { |
|
|
|
|
|
|
|
Write-Warning -Message ("$ProductJsonPath 解析失败") |
|
|
|
|
|
|
|
[System.Environment]::Exit(0) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$Version = $ProductInfo.'version' |
|
|
|
|
|
|
|
if (!$Version) { |
|
|
|
|
|
|
|
Write-Warning -Message ("$ProductJsonPath 不存在 version 信息") |
|
|
|
|
|
|
|
[System.Environment]::Exit(0) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return $Version |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$VersionInfo = GetVertion |
|
|
|
|
|
|
|
|
|
|
|
if ($Version) { |
|
|
|
if ($Version) { |
|
|
|
return $VersionInfo |
|
|
|
return $VersionInfo |
|
|
@ -964,7 +994,7 @@ Clear-Host |
|
|
|
$PSDefaultParameterValues['*:Encoding'] = 'utf8' |
|
|
|
$PSDefaultParameterValues['*:Encoding'] = 'utf8' |
|
|
|
$Host.UI.RawUI.WindowTitle = 'Windows 应答文件生成' |
|
|
|
$Host.UI.RawUI.WindowTitle = 'Windows 应答文件生成' |
|
|
|
Set-Location -Path $PSScriptRoot |
|
|
|
Set-Location -Path $PSScriptRoot |
|
|
|
Write-Host -Object "=====> Windows 系统自动安装应答文件生成 $VersionInfo <=====" |
|
|
|
Write-Host -Object "=====> Windows 系统自动安装应答文件生成 v$VersionInfo <=====" |
|
|
|
Write-Host -Object '' |
|
|
|
Write-Host -Object '' |
|
|
|
|
|
|
|
|
|
|
|
$WipeDisk = $false |
|
|
|
$WipeDisk = $false |
|
|
@ -1093,13 +1123,11 @@ else { |
|
|
|
|
|
|
|
|
|
|
|
$VentoyConfigParentPath = Join-Path -Path $ParentPath -ChildPath 'ventoy' |
|
|
|
$VentoyConfigParentPath = Join-Path -Path $ParentPath -ChildPath 'ventoy' |
|
|
|
if (!$(Test-Path -Path $VentoyConfigParentPath -PathType Container)) { |
|
|
|
if (!$(Test-Path -Path $VentoyConfigParentPath -PathType Container)) { |
|
|
|
New-Item -Path $VentoyConfigParentPath -ItemType Directory -Force |
|
|
|
New-Item -Path $VentoyConfigParentPath -ItemType Directory -Force | Out-Null |
|
|
|
Write-Host -Object '' |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
$VentoyConfigScriptPath = Join-Path -Path $VentoyConfigParentPath -ChildPath 'script' |
|
|
|
$VentoyConfigScriptPath = Join-Path -Path $VentoyConfigParentPath -ChildPath 'script' |
|
|
|
if (!$(Test-Path -Path $VentoyConfigScriptPath -PathType Container)) { |
|
|
|
if (!$(Test-Path -Path $VentoyConfigScriptPath -PathType Container)) { |
|
|
|
New-Item -Path $VentoyConfigScriptPath -ItemType Directory -Force |
|
|
|
New-Item -Path $VentoyConfigScriptPath -ItemType Directory -Force | Out-Null |
|
|
|
Write-Host -Object '' |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
$ProductInfo = @{} |
|
|
|
$ProductInfo = @{} |
|
|
|