Merge pull request #90 from Romanitho/minor-changes

Clean before install (in case of previous version)
pull/92/head
Romain 2022-05-29 15:47:57 +02:00 committed by GitHub
commit 99eebc0819
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 1 deletions

View File

@ -164,10 +164,13 @@ function Install-WingetAutoUpdate{
Write-Host "`nInstalling WAU..." -ForegroundColor Yellow Write-Host "`nInstalling WAU..." -ForegroundColor Yellow
try{ try{
#Copy files to location #Copy files to location (and clean old install)
if (!(Test-Path $WingetUpdatePath)){ if (!(Test-Path $WingetUpdatePath)){
New-Item -ItemType Directory -Force -Path $WingetUpdatePath | Out-Null 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 Copy-Item -Path "$PSScriptRoot\Winget-AutoUpdate\*" -Destination $WingetUpdatePath -Recurse -Force -ErrorAction SilentlyContinue
#White List or Black List apps #White List or Black List apps