Skip to content

Commit e9d131c

Browse files
committed
refactor: use explict parameters
- align switch block
1 parent f1e79e8 commit e9d131c

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

tiny11maker.ps1

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ switch ((Get-WindowsImage -ImagePath $wimFilePath -Index $index).Architecture)
119119
{
120120
0 { $architecture = "x86" }
121121
9 { $architecture = "amd64" }
122-
12 {$architecture = "arm64" }
122+
12 { $architecture = "arm64" }
123123
}
124124

125125
if (Test-Path variable:architecture) {
@@ -444,19 +444,19 @@ if ($null -ne $WinSDKPath) {
444444
}
445445
$localOSCDIMGPath = "$PSScriptRoot\oscdimg.exe"
446446

447-
if ((Test-Path variable:ADKDepTools) -and (Test-Path "$ADKDepTools\oscdimg.exe" -PathType leaf)) {
447+
if ((Test-Path variable:ADKDepTools) -and (Test-Path -Path "$ADKDepTools\oscdimg.exe" -PathType Leaf)) {
448448
Write-Host "Will be using oscdimg.exe from system ADK."
449449
$OSCDIMG = "$ADKDepTools\oscdimg.exe"
450450
} else {
451451
Write-Host "oscdimg.exe from system ADK not found. Will be using bundled oscdimg.exe."
452452

453453
$url = "https://msdl.microsoft.com/download/symbols/oscdimg.exe/3D44737265000/oscdimg.exe"
454454

455-
if (-not (Test-Path -Path $localOSCDIMGPath)) {
455+
if (-not (Test-Path -Path $localOSCDIMGPath -PathType Leaf)) {
456456
Write-Host "Downloading oscdimg.exe..."
457457
Invoke-WebRequest -Uri $url -OutFile $localOSCDIMGPath
458458

459-
if (Test-Path $localOSCDIMGPath) {
459+
if (Test-Path -Path $localOSCDIMGPath -PathType Leaf) {
460460
Write-Host "oscdimg.exe downloaded successfully."
461461
} else {
462462
Write-Error "Failed to download oscdimg.exe."

0 commit comments

Comments
 (0)