From 5dceecb80c75d95cf7d31e1a76309e4628d5be51 Mon Sep 17 00:00:00 2001 From: Romain <96626929+Romanitho@users.noreply.github.com> Date: Tue, 22 Mar 2022 18:19:30 +0100 Subject: [PATCH] Update Update-WAU.ps1 --- Winget-AutoUpdate/functions/Update-WAU.ps1 | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Winget-AutoUpdate/functions/Update-WAU.ps1 b/Winget-AutoUpdate/functions/Update-WAU.ps1 index 390447b..1482512 100644 --- a/Winget-AutoUpdate/functions/Update-WAU.ps1 +++ b/Winget-AutoUpdate/functions/Update-WAU.ps1 @@ -24,8 +24,11 @@ function Update-WAU ($VersionToUpdate){ Expand-Archive -Path $ZipFile -DestinationPath $location -Force Get-ChildItem -Path $location -Recurse | Unblock-File Write-Log "Unzip finished" "Green" - $TempPath = (Resolve-Path "$location\*\Winget-AutoUpdate\").Path - Copy-Item -Path "$TempPath\*" -Destination "$WorkingDir\" -Exclude "icons" -Recurse -Force + $TempPath = (Resolve-Path "$location\*\Winget-AutoUpdate\")[0].Path + $TempPath = (Resolve-Path "$location\*\Winget-AutoUpdate\")[0].Path + if ($TempPath){ + Copy-Item -Path "$TempPath\*" -Destination "$WorkingDir\" -Exclude "icons" -Recurse -Force + } #Remove update zip file Write-Log "Cleaning temp files"