Fixes wrong Url for stable Plugin Release

Fixes #36
This commit is contained in:
Christian Stein 2019-12-17 17:19:48 +01:00
parent 4b87a68b58
commit 9733bde88b

View file

@ -15,7 +15,7 @@ function Get-IcingaPowerShellModuleArchive()
if ($branch.ToLower() -eq 'snapshot') {
$DownloadUrl = [string]::Format('https://github.com/Icinga/{0}/archive/master.zip', $Repository);
} else {
$LatestRelease = (Invoke-WebRequest -Uri 'https://github.com/Icinga/icinga-powershell-framework/releases/latest' -UseBasicParsing).BaseResponse.ResponseUri.AbsoluteUri;
$LatestRelease = (Invoke-WebRequest -Uri ([string]::Format('https://github.com/Icinga/{0}/releases/latest', $Repository)) -UseBasicParsing).BaseResponse.ResponseUri.AbsoluteUri;
$DownloadUrl = $LatestRelease.Replace('/releases/tag/', '/archive/');
$Tag = $DownloadUrl.Split('/')[-1];
$DownloadUrl = [string]::Format('{0}/{1}.zip', $DownloadUrl, $Tag);