This commit is contained in:
XXXXRT666 2025-05-14 06:41:03 +01:00
parent 4b3b90280e
commit cbf9a9bdbd

View File

@ -57,8 +57,15 @@ function DownloadAndUnzip($url, $targetRelPath) {
$tmpZip = "$tmpDir\$filename" $tmpZip = "$tmpDir\$filename"
Invoke-WebRequest $url -OutFile $tmpZip Invoke-WebRequest $url -OutFile $tmpZip
Expand-Archive -Path $tmpZip -DestinationPath $tmpDir -Force Expand-Archive -Path $tmpZip -DestinationPath $tmpDir -Force
Get-ChildItem . $subdirName = $filename -replace '\.zip$', ''
Move-Item "$tmpDir\$($filename -replace '\.zip$', '')" "$srcDir\$targetRelPath" -Force $sourcePath = Join-Path $tmpDir $subdirName
$destRoot = Join-Path $srcDir $targetRelPath
$destPath = Join-Path $destRoot $subdirName
if (Test-Path $destPath) {
Remove-Item $destPath -Recurse -Force
}
Move-Item $sourcePath $destRoot
Remove-Item $tmpZip Remove-Item $tmpZip
} }