diff --git a/doc/31-Changelog.md b/doc/31-Changelog.md index 958d20a..c739a08 100644 --- a/doc/31-Changelog.md +++ b/doc/31-Changelog.md @@ -38,6 +38,7 @@ Released closed milestones can be found on [GitHub](https://github.com/Icinga/ic * [#333](https://github.com/Icinga/icinga-powershell-framework/pull/333) Adds Cmdlet `Test-IcingaForWindowsService` to test the Icinga for Windows service configuration * [#338](https://github.com/Icinga/icinga-powershell-framework/pull/338) Improves various styles, outputs and view for the Icinga for Windows Management Console and fixes some spelling mistakes * [#342](https://github.com/Icinga/icinga-powershell-framework/pull/342) Adds feature to print commands being executed by the Icinga Management Console with `l` and improves summary visualisation for better readability +* [#346](https://github.com/Icinga/icinga-powershell-framework/pull/346) Adds support for version names for snapshots ## 1.5.2 (2021-07-09) diff --git a/lib/core/repository/Get-IcingaRepositoryPackage.psm1 b/lib/core/repository/Get-IcingaRepositoryPackage.psm1 index 47e718e..5e7fc89 100644 --- a/lib/core/repository/Get-IcingaRepositoryPackage.psm1 +++ b/lib/core/repository/Get-IcingaRepositoryPackage.psm1 @@ -65,7 +65,19 @@ function Get-IcingaRepositoryPackage() continue; } - if ([string]::IsNullOrEmpty($Version) -And ($null -eq $LatestVersion -Or $LatestVersion -lt $package.Version)) { + if ($Snapshot -And [string]::IsNullOrEmpty($Version) -eq $FALSE -And (Test-Numeric $package.Version.Replace('.', '')) -eq $FALSE -And (Test-Numeric $Version) -eq $FALSE -And $package.Version -eq $Version) { + $InstallPackage = $package; + $HasRepo = $TRUE; + $SourceRepo = $RepoContent; + $RepoName = $entry.Name; + break; + } + + if ((Test-Numeric $package.Version.Replace('.', '')) -eq $FALSE -Or ((Test-Numeric $Version.Replace('.', '')) -eq $FALSE -And [string]::IsNullOrEmpty($Version) -eq $FALSE) ) { + continue; + } + + if (([string]::IsNullOrEmpty($Version) -And ($null -eq $LatestVersion -Or $LatestVersion -lt $package.Version))) { [Version]$LatestVersion = [Version]$package.Version; $InstallPackage = $package; $HasRepo = $TRUE;