Files
Mario Loriedo af607d0de4 Add win installer patch
Adding a patch to the bundle so that the update from previous version
(v5.3.1) is a minor update, not a major one. A minor update prevents the
full uninstallation of v5.3.1 and an unrequested reboot of the machine.

Signed-off-by: Mario Loriedo <mario.loriedo@gmail.com>
2024-12-12 15:56:28 +01:00

24 lines
905 B
PowerShell

#!/usr/bin/env pwsh
function Get-Latest-Podman-Setup-From-GitHub {
return Get-Podman-Setup-From-GitHub "latest"
}
function Get-Podman-Setup-From-GitHub {
param(
[Parameter(Mandatory)]
[string] $version
)
Write-Host "Downloading the $version Podman windows setup from GitHub..."
$apiUrl = "https://api.github.com/repos/containers/podman/releases/$version"
$response = Invoke-RestMethod -Uri $apiUrl -Headers @{"User-Agent"="PowerShell"} -ErrorAction Stop
$downloadUrl = $response.assets[0].browser_download_url
Write-Host "Downloading URL: $downloadUrl"
$latestTag = $response.tag_name
$destinationPath = "$PSScriptRoot\podman-$latestTag-setup.exe"
Write-Host "Destination Path: $destinationPath"
Invoke-WebRequest -Uri $downloadUrl -OutFile $destinationPath
Write-Host "Command completed successfully!`n"
return $destinationPath
}