diff --git a/lib/core/framework/Get-IcingaPowerShellModuleArchive.psm1 b/lib/core/framework/Get-IcingaPowerShellModuleArchive.psm1 index 1746f6d..4f6025d 100644 --- a/lib/core/framework/Get-IcingaPowerShellModuleArchive.psm1 +++ b/lib/core/framework/Get-IcingaPowerShellModuleArchive.psm1 @@ -26,7 +26,14 @@ function Get-IcingaPowerShellModuleArchive() if ($null -ne $CurrentVersion -And $CurrentVersion -eq $Tag) { Write-Host ([string]::Format('Your "{0}" is already up-to-date', $ModuleName)); - return; + return @{ + 'DownloadUrl' = $DownloadUrl; + 'Version' = $Tag; + 'Directory' = ''; + 'Archive' = ''; + 'ModuleRoot' = (Get-IcingaFrameworkRootPath); + 'Installed' = $FALSE; + }; } } } else { @@ -56,5 +63,6 @@ function Get-IcingaPowerShellModuleArchive() 'Directory' = $DownloadDirectory; 'Archive' = $DownloadDestination; 'ModuleRoot' = (Get-IcingaFrameworkRootPath); + 'Installed' = $TRUE; }; } diff --git a/lib/core/framework/Install-IcingaFrameworkPlugins.psm1 b/lib/core/framework/Install-IcingaFrameworkPlugins.psm1 index aa573ea..7d11b40 100644 --- a/lib/core/framework/Install-IcingaFrameworkPlugins.psm1 +++ b/lib/core/framework/Install-IcingaFrameworkPlugins.psm1 @@ -7,6 +7,12 @@ function Install-IcingaFrameworkPlugins() $RepositoryName = 'icinga-powershell-plugins'; $Archive = Get-IcingaPowerShellModuleArchive -DownloadUrl $PluginsUrl -ModuleName 'Icinga Plugins' -Repository $RepositoryName; + if ($Archive.Installed -eq $FALSE) { + return @{ + 'PluginUrl' = $Archive.DownloadUrl + }; + } + Write-Host ([string]::Format('Installing module into "{0}"', ($Archive.Directory))); Expand-IcingaZipArchive -Path $Archive.Archive -Destination $Archive.Directory | Out-Null; diff --git a/lib/core/framework/Install-IcingaFrameworkUpdate.psm1 b/lib/core/framework/Install-IcingaFrameworkUpdate.psm1 index cc9b0ca..b2cb4ba 100644 --- a/lib/core/framework/Install-IcingaFrameworkUpdate.psm1 +++ b/lib/core/framework/Install-IcingaFrameworkUpdate.psm1 @@ -7,6 +7,12 @@ function Install-IcingaFrameworkUpdate() $RepositoryName = 'icinga-powershell-framework'; $Archive = Get-IcingaPowerShellModuleArchive -DownloadUrl $FrameworkUrl -ModuleName 'Icinga Framework' -Repository $RepositoryName; + if ($Archive.Installed -eq $FALSE) { + return @{ + 'PluginUrl' = $Archive.DownloadUrl + }; + } + Write-Host ([string]::Format('Installing module into "{0}"', ($Archive.Directory))); Expand-IcingaZipArchive -Path $Archive.Archive -Destination $Archive.Directory | Out-Null;