2023-09-15 14:33:51 +00:00
|
|
|
# Function to get the latest WAU available version on Github
|
|
|
|
|
2023-09-15 14:38:54 +00:00
|
|
|
function Get-WAUAvailableVersion
|
2023-09-15 14:33:51 +00:00
|
|
|
{
|
|
|
|
# Get Github latest version
|
2023-09-15 14:38:54 +00:00
|
|
|
if ($WAUConfig.WAU_UpdatePrerelease -eq 1)
|
2023-09-15 14:33:51 +00:00
|
|
|
{
|
|
|
|
# Log
|
|
|
|
Write-ToLog -LogMsg 'WAU AutoUpdate Pre-release versions is Enabled' -LogColor 'Cyan'
|
2023-09-15 14:40:37 +00:00
|
|
|
|
2023-09-15 14:33:51 +00:00
|
|
|
# Get latest pre-release info
|
|
|
|
$WAUurl = 'https://api.github.com/repos/Romanitho/Winget-AutoUpdate/releases'
|
|
|
|
}
|
2023-09-15 14:38:54 +00:00
|
|
|
else
|
2023-09-15 14:33:51 +00:00
|
|
|
{
|
|
|
|
# Get latest stable info
|
|
|
|
$WAUurl = 'https://api.github.com/repos/Romanitho/Winget-AutoUpdate/releases/latest'
|
|
|
|
}
|
2023-09-15 14:40:37 +00:00
|
|
|
|
2023-09-15 14:33:51 +00:00
|
|
|
# Return version
|
|
|
|
return ((Invoke-WebRequest -Uri $WAUurl -UseBasicParsing | ConvertFrom-Json)[0].tag_name).Replace('v', '')
|
2022-10-26 22:49:10 +00:00
|
|
|
}
|