2023-03-31 15:56:07 +00:00
|
|
|
#Function to get the latest WAU available version on Github
|
2022-04-13 16:50:06 +00:00
|
|
|
|
2022-03-26 15:02:00 +00:00
|
|
|
function Get-WAUAvailableVersion {
|
2022-04-13 16:50:06 +00:00
|
|
|
|
2022-03-22 13:39:01 +00:00
|
|
|
#Get Github latest version
|
2022-05-22 13:27:45 +00:00
|
|
|
if ($WAUConfig.WAU_UpdatePrerelease -eq 1) {
|
2022-10-26 22:49:10 +00:00
|
|
|
|
2022-05-25 10:26:29 +00:00
|
|
|
#Log
|
2023-04-01 14:08:52 +00:00
|
|
|
Write-ToLog "WAU AutoUpdate Pre-release versions is Enabled" "Cyan"
|
2022-10-26 22:49:10 +00:00
|
|
|
|
2022-03-26 15:02:00 +00:00
|
|
|
#Get latest pre-release info
|
|
|
|
$WAUurl = 'https://api.github.com/repos/Romanitho/Winget-AutoUpdate/releases'
|
2022-10-26 22:49:10 +00:00
|
|
|
|
2022-03-26 15:02:00 +00:00
|
|
|
}
|
|
|
|
else {
|
2022-10-26 22:49:10 +00:00
|
|
|
|
2022-03-26 15:02:00 +00:00
|
|
|
#Get latest stable info
|
|
|
|
$WAUurl = 'https://api.github.com/repos/Romanitho/Winget-AutoUpdate/releases/latest'
|
2022-10-26 22:49:10 +00:00
|
|
|
|
2022-03-26 15:02:00 +00:00
|
|
|
}
|
2022-04-13 16:50:06 +00:00
|
|
|
|
2023-04-18 09:44:59 +00:00
|
|
|
#Return version to windows format (1.0.0 or 1.0.0.0 for nightlies)
|
|
|
|
return (((Invoke-WebRequest $WAUurl -UseBasicParsing | ConvertFrom-Json)[0].tag_name).Replace("v", "")).Replace("-", ".")
|
2022-04-13 16:50:06 +00:00
|
|
|
|
2022-10-26 22:49:10 +00:00
|
|
|
}
|