Closed 1ckov closed 2 years ago
Ooo that's good. I'll add that, thank you. :-)
Thanks again, updated everything and also added your name as an author in the script comments.
FYI - added the script to PSGallery so you don't even have to download the file now, see readme. 😀
Release: https://github.com/asheroto/winget-installer/releases/tag/0.0.3
One additional suggestion for this: Would you mind, changing $uri to "https://api.github.com/repos/microsoft/winget-cli/releases/latest" ? Currently the code (which runs awesome!) installs pre-releases.
Thanks again, updated everything and also added your name as an author in the script comments.
FYI - added the script to PSGallery so you don't even have to download the file now, see readme. 😀
Release: https://github.com/asheroto/winget-installer/releases/tag/0.0.3
Thank you so much as well, this new trick with the PSGallery, makes life even more easier for my and @obnys'es Project.
Good catch! #2
function getNewestLink($match){ $uri = "https://api.github.com/repos/microsoft/winget-cli/releases" Write-Verbose "[$((Get-Date).TimeofDay)] Getting information from $uri" $get = Invoke-RestMethod -uri $uri -Method Get -ErrorAction stop Write-Verbose "[$((Get-Date).TimeofDay)] getting latest release" $data = $get[0].assets | Where-Object name -Match $match return $data.browser_download_url }
$wingetUrl=getNewestLink("msixbundle") $wingetLicenseUrl=getNewestLink("License1.xml")