Merge pull request #463 from KnifMelti/propose

Now returns success, fail or current from Update-WinGet
pull/464/head
Romain 2023-11-01 23:06:07 +01:00 committed by GitHub
commit 511b4cadc6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 1 deletions

View File

@ -69,17 +69,24 @@ Function Update-WinGet {
$WingetCmd = $WingetInfo[-1].FileName
& $WingetCmd source reset --force
Write-ToLog "-> WinGet sources reset.`n" "green"
$return = "success"
}
catch {
Write-ToLog "-> Failed to install WinGet MSIXBundle for App Installer...`n" "red"
#Force Store Apps to update
Update-StoreApps
$return = "fail"
}
#Remove WinGet MSIXBundle
Remove-Item -Path $WingetInstaller -Force -ErrorAction SilentlyContinue
#Return status
return $return
}
else {
Write-ToLog "-> WinGet is up to date: v$WinGetInstalledVersion`n" "Green"
return "current"
}
}