diff --git a/Winget-AutoUpdate-Install.ps1 b/Winget-AutoUpdate-Install.ps1 index c81707f..fc12c72 100644 --- a/Winget-AutoUpdate-Install.ps1 +++ b/Winget-AutoUpdate-Install.ps1 @@ -164,10 +164,13 @@ function Install-WingetAutoUpdate{ Write-Host "`nInstalling WAU..." -ForegroundColor Yellow try{ - #Copy files to location + #Copy files to location (and clean old install) if (!(Test-Path $WingetUpdatePath)){ New-Item -ItemType Directory -Force -Path $WingetUpdatePath | Out-Null } + else { + Remove-Item -Path "$WingetUpdatePath\*" -Recurse -Force + } Copy-Item -Path "$PSScriptRoot\Winget-AutoUpdate\*" -Destination $WingetUpdatePath -Recurse -Force -ErrorAction SilentlyContinue #White List or Black List apps