asheroto / winget-install

Install winget tool using PowerShell! Prerequisites automatically installed. Works on Windows 10/11 and Server 2019/2022.
https://bit.ly/winget-install
GNU General Public License v3.0
272 stars 33 forks source link

Suggestion to always get the newest version of winget from github #1

Closed 1ckov closed 2 years ago

1ckov commented 2 years ago

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")

asheroto commented 2 years ago

Ooo that's good. I'll add that, thank you. :-)

asheroto commented 2 years ago

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

obnys commented 2 years ago

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.

1ckov commented 2 years ago

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.

asheroto commented 2 years ago

Good catch! #2