Merge pull request #160 from Icinga:fix/install_release_components_fails_with_new_web_method

Fix: Instaling PowerShell components fails for release branch

Installing IcingaPowerShell components fails with new web method for release packages
This commit is contained in:
Lord Hepipud 2020-11-20 12:05:33 +01:00 committed by GitHub
commit 8769c8dd6d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -72,7 +72,7 @@ function Get-IcingaPowerShellModuleArchive()
} else {
$WebResponse = Invoke-IcingaWebRequest -Uri 'https://github.com/{0}/{1}/releases/latest' -Objects $GitHubUser, $Repository -UseBasicParsing;
if ($WebResponse.HasErrors -eq $FALSE) {
if ($null -eq $WebResponse.HasErrors -Or $WebResponse.HasErrors -eq $FALSE) {
$LatestRelease = $WebResponse.BaseResponse.ResponseUri.AbsoluteUri;
$DownloadUrl = $LatestRelease.Replace('/releases/tag/', '/archive/');
$Tag = $DownloadUrl.Split('/')[-1];