Skip to content

Commit df0d24b

Browse files
authored
Merge pull request #660 from Icinga:fix/broken_update_icinga_command
Fix: Update-Icinga not updating to latest or specified version Fixes `Update-Icinga` not updating to the latest available version for a component and specifying `-Version` is updating to the latest one instead of the given one instead
2 parents 093c5e7 + 17d884d commit df0d24b

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

doc/100-General/10-Changelog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ Released closed milestones can be found on [GitHub](https://github.com/Icinga/ic
1414
### Bugfixes
1515

1616
* [#659](https://github.com/Icinga/icinga-powershell-framework/pull/659) Fixes configuration writer which publishes invalid Icinga plain configuration files
17+
* [#660](https://github.com/Icinga/icinga-powershell-framework/pull/660) Fixes `Update-Icinga` not updating to the latest available version for a component and specifying `-Version` is updating to the latest one instead of the given one instead
1718

1819
## 1.11.0 (2023-08-01)
1920

lib/core/repository/Update-Icinga.psm1

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ function Update-Icinga()
2222
continue;
2323
}
2424

25-
if ([string]::IsNullOrEmpty($Version) -eq $FALSE){
26-
$NewVersion = $Component.LatestVersion;
27-
} else {
25+
$NewVersion = $Component.LatestVersion;
26+
27+
if ([string]::IsNullOrEmpty($Version) -eq $FALSE) {
2828
$NewVersion = $Version;
2929
}
3030

0 commit comments

Comments
 (0)