Merge pull request #463 from KnifMelti/propose
Now returns success, fail or current from Update-WinGetpull/464/head
commit
511b4cadc6
|
@ -69,17 +69,24 @@ Function Update-WinGet {
|
||||||
$WingetCmd = $WingetInfo[-1].FileName
|
$WingetCmd = $WingetInfo[-1].FileName
|
||||||
& $WingetCmd source reset --force
|
& $WingetCmd source reset --force
|
||||||
Write-ToLog "-> WinGet sources reset.`n" "green"
|
Write-ToLog "-> WinGet sources reset.`n" "green"
|
||||||
|
$return = "success"
|
||||||
|
|
||||||
}
|
}
|
||||||
catch {
|
catch {
|
||||||
Write-ToLog "-> Failed to install WinGet MSIXBundle for App Installer...`n" "red"
|
Write-ToLog "-> Failed to install WinGet MSIXBundle for App Installer...`n" "red"
|
||||||
|
#Force Store Apps to update
|
||||||
Update-StoreApps
|
Update-StoreApps
|
||||||
|
$return = "fail"
|
||||||
}
|
}
|
||||||
|
|
||||||
#Remove WinGet MSIXBundle
|
#Remove WinGet MSIXBundle
|
||||||
Remove-Item -Path $WingetInstaller -Force -ErrorAction SilentlyContinue
|
Remove-Item -Path $WingetInstaller -Force -ErrorAction SilentlyContinue
|
||||||
|
|
||||||
|
#Return status
|
||||||
|
return $return
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
Write-ToLog "-> WinGet is up to date: v$WinGetInstalledVersion`n" "Green"
|
Write-ToLog "-> WinGet is up to date: v$WinGetInstalledVersion`n" "Green"
|
||||||
|
return "current"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue