Refactor Update-Scripts function to improve error handling and code structure

This commit is contained in:
2025-09-15 13:08:03 -04:00
parent 19fcecddcd
commit efb14e8527
3 changed files with 11 additions and 6 deletions

View File

@@ -62,6 +62,7 @@ function Update-Scripts {
if (Test-Path $zipPath -and (Get-Item $zipPath).Length -gt 0) {
Write-Host "Download successful!" -ForegroundColor Green
try {
# Extract the zip file
Write-Host "Extracting update package..." -ForegroundColor Cyan
Expand-Archive -Path $zipPath -DestinationPath $tempDir -Force
@@ -115,6 +116,7 @@ function Update-Scripts {
return $false # Update failed
}
}
}
# Call the update function at the beginning
$scriptUpdated = Update-Scripts

View File

@@ -62,6 +62,7 @@ function Update-Scripts {
if (Test-Path $zipPath -and (Get-Item $zipPath).Length -gt 0) {
Write-Host "Download successful!" -ForegroundColor Green
try {
# Extract the zip file
Write-Host "Extracting update package..." -ForegroundColor Cyan
Expand-Archive -Path $zipPath -DestinationPath $tempDir -Force
@@ -115,6 +116,7 @@ function Update-Scripts {
return $false # Update failed
}
}
}
# Call the update function at the beginning
$scriptUpdated = Update-Scripts

View File

@@ -62,6 +62,7 @@ function Update-Scripts {
if (Test-Path $zipPath -and (Get-Item $zipPath).Length -gt 0) {
Write-Host "Download successful!" -ForegroundColor Green
try {
# Extract the zip file
Write-Host "Extracting update package..." -ForegroundColor Cyan
Expand-Archive -Path $zipPath -DestinationPath $tempDir -Force