diff --git a/1_Install.ps1 b/1_Install.ps1 index dc76a4b..c67f127 100644 --- a/1_Install.ps1 +++ b/1_Install.ps1 @@ -59,7 +59,7 @@ function Update-Scripts { } # Check if the download was successful (file exists and is not empty) - if (Test-Path $zipPath -and (Get-Item $zipPath).Length -gt 0) { + if ((Test-Path $zipPath) -and ((Get-Item $zipPath).Length -gt 0)) { Write-Host "Download successful!" -ForegroundColor Green try { @@ -70,7 +70,7 @@ function Update-Scripts { # Find the extracted directory $extractedDir = Get-ChildItem -Path $tempDir -Directory | Select-Object -First 1 - if ($extractedDir -and (Test-Path $extractedDir.FullName)) { + if (($extractedDir) -and ((Test-Path $extractedDir.FullName))) { # Copy all files except .git directory to current location Write-Host "Installing updates..." -ForegroundColor Cyan Get-ChildItem -Path $extractedDir.FullName | Where-Object { $_.Name -ne ".git" } | ForEach-Object { diff --git a/2_ConfigUpdate.ps1 b/2_ConfigUpdate.ps1 index 205c32b..946843b 100644 --- a/2_ConfigUpdate.ps1 +++ b/2_ConfigUpdate.ps1 @@ -59,7 +59,7 @@ function Update-Scripts { } # Check if the download was successful (file exists and is not empty) - if (Test-Path $zipPath -and (Get-Item $zipPath).Length -gt 0) { + if ((Test-Path $zipPath) -and ((Get-Item $zipPath).Length -gt 0)) { Write-Host "Download successful!" -ForegroundColor Green try { @@ -70,7 +70,7 @@ function Update-Scripts { # Find the extracted directory $extractedDir = Get-ChildItem -Path $tempDir -Directory | Select-Object -First 1 - if ($extractedDir -and (Test-Path $extractedDir.FullName)) { + if (($extractedDir) -and ((Test-Path $extractedDir.FullName))) { # Copy all files except .git directory to current location Write-Host "Installing updates..." -ForegroundColor Cyan Get-ChildItem -Path $extractedDir.FullName | Where-Object { $_.Name -ne ".git" } | ForEach-Object { diff --git a/3_ConfigAfterNextcloud.ps1 b/3_ConfigAfterNextcloud.ps1 index 363be86..3f17f31 100644 --- a/3_ConfigAfterNextcloud.ps1 +++ b/3_ConfigAfterNextcloud.ps1 @@ -59,7 +59,7 @@ function Update-Scripts { } # Check if the download was successful (file exists and is not empty) - if (Test-Path $zipPath -and (Get-Item $zipPath).Length -gt 0) { + if ((Test-Path $zipPath) -and ((Get-Item $zipPath).Length -gt 0)) { Write-Host "Download successful!" -ForegroundColor Green try { @@ -70,7 +70,7 @@ function Update-Scripts { # Find the extracted directory $extractedDir = Get-ChildItem -Path $tempDir -Directory | Select-Object -First 1 - if ($extractedDir -and (Test-Path $extractedDir.FullName)) { + if (($extractedDir) -and ((Test-Path $extractedDir.FullName))) { # Copy all files except .git directory to current location Write-Host "Installing updates..." -ForegroundColor Cyan Get-ChildItem -Path $extractedDir.FullName | Where-Object { $_.Name -ne ".git" } | ForEach-Object {