13 lines
537 B
PowerShell
13 lines
537 B
PowerShell
function Get-WAUAvailableVersion {
|
|
#Get Github latest version
|
|
if ($true -eq $WAUprerelease) {
|
|
#Get latest pre-release info
|
|
$WAUurl = 'https://api.github.com/repos/Romanitho/Winget-AutoUpdate/releases'
|
|
}
|
|
else {
|
|
#Get latest stable info
|
|
$WAUurl = 'https://api.github.com/repos/Romanitho/Winget-AutoUpdate/releases/latest'
|
|
}
|
|
$Script:WAULatestVersion = ((Invoke-WebRequest $WAUurl -UseBasicParsing | ConvertFrom-Json)[0].tag_name).Replace("v","")
|
|
return [version]$WAULatestVersion
|
|
} |