mirror of
https://github.com/Icinga/icinga-powershell-framework.git
synced 2025-12-21 07:10:15 -05:00
Merge pull request #195 from Icinga/fix/installer_crash_on_agent_msi_installer_package_detection
Fix: Agent installer crash on package lookup with different files in directory
This commit is contained in:
commit
856e7624cc
2 changed files with 17 additions and 3 deletions
|
|
@ -20,6 +20,7 @@ Released closed milestones can be found on [GitHub](https://github.com/Icinga/ic
|
||||||
* [#186](https://github.com/Icinga/icinga-powershell-framework/issues/186) Fixes path handling for custom local/web path sources for service binary installation
|
* [#186](https://github.com/Icinga/icinga-powershell-framework/issues/186) Fixes path handling for custom local/web path sources for service binary installation
|
||||||
* [#188](https://github.com/Icinga/icinga-powershell-framework/pull/188) Removes hardcoded zones `director-global` and `global-zones` which were always set regardless of user specification. This fix will ensure the user has the option to add or not add these zones
|
* [#188](https://github.com/Icinga/icinga-powershell-framework/pull/188) Removes hardcoded zones `director-global` and `global-zones` which were always set regardless of user specification. This fix will ensure the user has the option to add or not add these zones
|
||||||
* [#189](https://github.com/Icinga/icinga-powershell-framework/pull/189) Fixes wrong documented user group for accessing Performance Counter objects which should be `Performance Monitor Users`
|
* [#189](https://github.com/Icinga/icinga-powershell-framework/pull/189) Fixes wrong documented user group for accessing Performance Counter objects which should be `Performance Monitor Users`
|
||||||
|
* [#195](https://github.com/Icinga/icinga-powershell-framework/pull/195) Fix Agent installer crash on package lookup with different files in directory
|
||||||
|
|
||||||
## 1.3.0 (2020-12-01)
|
## 1.3.0 (2020-12-01)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,16 @@ function Get-IcingaAgentMSIPackage()
|
||||||
$Content = Get-ChildItem -Path $Source;
|
$Content = Get-ChildItem -Path $Source;
|
||||||
|
|
||||||
foreach ($entry in $Content) {
|
foreach ($entry in $Content) {
|
||||||
$PackageVersion = ($entry.Name.Split('-')[1]).Replace('v', '');
|
# Only check for MSI packages
|
||||||
|
if ($entry.Extension.ToLower() -ne '.msi') {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
$PackageVersion = '';
|
||||||
|
|
||||||
|
if ($entry.Name.ToLower().Contains('-')) {
|
||||||
|
$PackageVersion = ($entry.Name.Split('-')[1]).Replace('v', '');
|
||||||
|
}
|
||||||
|
|
||||||
if ($Version -eq 'snapshot') {
|
if ($Version -eq 'snapshot') {
|
||||||
if ($PackageVersion -eq 'snapshot') {
|
if ($PackageVersion -eq 'snapshot') {
|
||||||
|
|
@ -40,8 +49,12 @@ function Get-IcingaAgentMSIPackage()
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($null -eq $UseVersion -Or [version]$PackageVersion -ge [version]$UseVersion) {
|
try {
|
||||||
$UseVersion = $PackageVersion;
|
if ($null -eq $UseVersion -Or [version]$PackageVersion -ge [version]$UseVersion) {
|
||||||
|
$UseVersion = $PackageVersion;
|
||||||
|
}
|
||||||
|
} catch {
|
||||||
|
# Nothing to catch specifically
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue