Merge pull request #99 from Romanitho/dev

Added Winget source reset
pull/100/head v1.11.3
Romain 2022-06-03 21:54:53 +02:00 committed by GitHub
commit 496b6d45ee
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 0 deletions

View File

@ -5,6 +5,15 @@ function Invoke-PostUpdateActions {
#log #log
Write-Log "Running Post Update actions..." "yellow" Write-Log "Running Post Update actions..." "yellow"
#Reset Winget Sources
$ResolveWingetPath = Resolve-Path "$env:programfiles\WindowsApps\Microsoft.DesktopAppInstaller_*_x64__8wekyb3d8bbwe\winget.exe"
if ($ResolveWingetPath){
#If multiple version, pick last one
$WingetPath = $ResolveWingetPath[-1].Path
& $WingetPath source reset --force
Write-Log "-> Winget sources reseted." "green"
}
#Create WAU Regkey if not present #Create WAU Regkey if not present
$regPath = "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Winget-AutoUpdate" $regPath = "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Winget-AutoUpdate"
if (!(test-path $regPath)) { if (!(test-path $regPath)) {