mirror of
https://github.com/ntdevlabs/tiny11builder.git
synced 2025-03-13 02:05:29 +00:00
refactor: use explict parameters
- align switch block
This commit is contained in:
parent
f1e79e8d16
commit
e9d131c691
@ -119,7 +119,7 @@ switch ((Get-WindowsImage -ImagePath $wimFilePath -Index $index).Architecture)
|
|||||||
{
|
{
|
||||||
0 { $architecture = "x86" }
|
0 { $architecture = "x86" }
|
||||||
9 { $architecture = "amd64" }
|
9 { $architecture = "amd64" }
|
||||||
12 {$architecture = "arm64" }
|
12 { $architecture = "arm64" }
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Test-Path variable:architecture) {
|
if (Test-Path variable:architecture) {
|
||||||
@ -444,7 +444,7 @@ if ($null -ne $WinSDKPath) {
|
|||||||
}
|
}
|
||||||
$localOSCDIMGPath = "$PSScriptRoot\oscdimg.exe"
|
$localOSCDIMGPath = "$PSScriptRoot\oscdimg.exe"
|
||||||
|
|
||||||
if ((Test-Path variable:ADKDepTools) -and (Test-Path "$ADKDepTools\oscdimg.exe" -PathType leaf)) {
|
if ((Test-Path variable:ADKDepTools) -and (Test-Path -Path "$ADKDepTools\oscdimg.exe" -PathType Leaf)) {
|
||||||
Write-Host "Will be using oscdimg.exe from system ADK."
|
Write-Host "Will be using oscdimg.exe from system ADK."
|
||||||
$OSCDIMG = "$ADKDepTools\oscdimg.exe"
|
$OSCDIMG = "$ADKDepTools\oscdimg.exe"
|
||||||
} else {
|
} else {
|
||||||
@ -452,11 +452,11 @@ if ((Test-Path variable:ADKDepTools) -and (Test-Path "$ADKDepTools\oscdimg.exe"
|
|||||||
|
|
||||||
$url = "https://msdl.microsoft.com/download/symbols/oscdimg.exe/3D44737265000/oscdimg.exe"
|
$url = "https://msdl.microsoft.com/download/symbols/oscdimg.exe/3D44737265000/oscdimg.exe"
|
||||||
|
|
||||||
if (-not (Test-Path -Path $localOSCDIMGPath)) {
|
if (-not (Test-Path -Path $localOSCDIMGPath -PathType Leaf)) {
|
||||||
Write-Host "Downloading oscdimg.exe..."
|
Write-Host "Downloading oscdimg.exe..."
|
||||||
Invoke-WebRequest -Uri $url -OutFile $localOSCDIMGPath
|
Invoke-WebRequest -Uri $url -OutFile $localOSCDIMGPath
|
||||||
|
|
||||||
if (Test-Path $localOSCDIMGPath) {
|
if (Test-Path -Path $localOSCDIMGPath -PathType Leaf) {
|
||||||
Write-Host "oscdimg.exe downloaded successfully."
|
Write-Host "oscdimg.exe downloaded successfully."
|
||||||
} else {
|
} else {
|
||||||
Write-Error "Failed to download oscdimg.exe."
|
Write-Error "Failed to download oscdimg.exe."
|
||||||
|
Loading…
Reference in New Issue
Block a user