wingetautoupdate/Winget-AutoUpdate/functions/Get-WAUAvailableVersion.ps1

21 lines
590 B
PowerShell
Raw Normal View History

2022-04-13 16:50:06 +00:00
#Function to get latest WAU available version on Github
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-03-26 15:02:00 +00:00
if ($true -eq $WAUprerelease) {
2022-04-13 16:50:06 +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-04-13 16:50:06 +00:00
2022-03-26 15:02:00 +00:00
}
else {
2022-04-13 16:50:06 +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-04-13 16:50:06 +00:00
2022-03-26 15:02:00 +00:00
}
2022-04-13 16:50:06 +00:00
2022-03-26 21:27:11 +00:00
$Script:WAUAvailableVersion = ((Invoke-WebRequest $WAUurl -UseBasicParsing | ConvertFrom-Json)[0].tag_name).Replace("v","")
2022-04-13 16:50:06 +00:00
2022-03-22 13:39:01 +00:00
}