mirror of
https://github.com/Icinga/icinga-powershell-framework.git
synced 2025-12-20 23:00:35 -05:00
Fix Framework root folder lookup
This commit is contained in:
parent
6edd99c432
commit
dfda9154e1
9 changed files with 21 additions and 11 deletions
|
|
@ -29,6 +29,7 @@ Released closed milestones can be found on [GitHub](https://github.com/Icinga/ic
|
||||||
|
|
||||||
* [#231](https://github.com/Icinga/icinga-powershell-framework/issues/231) Fixes error while using Icinga Director Self-Service API, in case the host or host API key was deleted inside the Icinga Director and the installation wizard was called with the correct template key, while the old host key was still present inside the Icinga for Windows configuration
|
* [#231](https://github.com/Icinga/icinga-powershell-framework/issues/231) Fixes error while using Icinga Director Self-Service API, in case the host or host API key was deleted inside the Icinga Director and the installation wizard was called with the correct template key, while the old host key was still present inside the Icinga for Windows configuration
|
||||||
* [#232](https://github.com/Icinga/icinga-powershell-framework/pull/232) Fixes wrong encoding while using REST-Api checks experimental feature, and now forces UTF8
|
* [#232](https://github.com/Icinga/icinga-powershell-framework/pull/232) Fixes wrong encoding while using REST-Api checks experimental feature, and now forces UTF8
|
||||||
|
* [#237](https://github.com/Icinga/icinga-powershell-framework/issues/237) Fixes `Icinga PowerShell Framework` root folder lookup, in case the module was installed with PowerShell gallery, which creates version folders for each installed version
|
||||||
* [#240](https://github.com/Icinga/icinga-powershell-framework/pull/240) While filtering for certain services with `Get-IcingaServices`, there were some attributes missing from the collection. These are now added resulting in always correct output data.
|
* [#240](https://github.com/Icinga/icinga-powershell-framework/pull/240) While filtering for certain services with `Get-IcingaServices`, there were some attributes missing from the collection. These are now added resulting in always correct output data.
|
||||||
* [#245](https://github.com/Icinga/icinga-powershell-framework/pull/245) Fixes loading of `.pfx` certificates by properly checking the file type
|
* [#245](https://github.com/Icinga/icinga-powershell-framework/pull/245) Fixes loading of `.pfx` certificates by properly checking the file type
|
||||||
* [#265](https://github.com/Icinga/icinga-powershell-framework/pull/265) Fixes `Test-Numeric` to now accept negative numeric values and als fixes errors, causing `.` to be allowed multiple times. `ConvertFrom-TimeSpan` now properly prints on negative values if the time provided is positive or negative and also prints microseconds as `us` in case the value is loer than `1ms`
|
* [#265](https://github.com/Icinga/icinga-powershell-framework/pull/265) Fixes `Test-Numeric` to now accept negative numeric values and als fixes errors, causing `.` to be allowed multiple times. `ConvertFrom-TimeSpan` now properly prints on negative values if the time provided is positive or negative and also prints microseconds as `us` in case the value is loer than `1ms`
|
||||||
|
|
|
||||||
|
|
@ -48,6 +48,7 @@
|
||||||
'Get-IcingaCacheDir',
|
'Get-IcingaCacheDir',
|
||||||
'Get-IcingaPowerShellConfigDir',
|
'Get-IcingaPowerShellConfigDir',
|
||||||
'Get-IcingaFrameworkRootPath',
|
'Get-IcingaFrameworkRootPath',
|
||||||
|
'Get-IcingaForWindowsRootPath',
|
||||||
'Get-IcingaPowerShellModuleFile',
|
'Get-IcingaPowerShellModuleFile',
|
||||||
'Start-IcingaShellAsUser',
|
'Start-IcingaShellAsUser',
|
||||||
'Get-IcingaPowerShellConfig',
|
'Get-IcingaPowerShellConfig',
|
||||||
|
|
|
||||||
|
|
@ -319,8 +319,16 @@ function Get-IcingaPowerShellConfigDir()
|
||||||
function Get-IcingaFrameworkRootPath()
|
function Get-IcingaFrameworkRootPath()
|
||||||
{
|
{
|
||||||
[string]$Path = $PSScriptRoot;
|
[string]$Path = $PSScriptRoot;
|
||||||
[int]$Index = $Path.LastIndexOf('\') + 1;
|
|
||||||
|
return $PSScriptRoot;
|
||||||
|
}
|
||||||
|
|
||||||
|
function Get-IcingaForWindowsRootPath()
|
||||||
|
{
|
||||||
|
[string]$Path = $PSScriptRoot;
|
||||||
|
[int]$Index = $Path.LastIndexOf('icinga-powershell-framework');
|
||||||
$Path = $Path.Substring(0, $Index);
|
$Path = $Path.Substring(0, $Index);
|
||||||
|
|
||||||
return $Path;
|
return $Path;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -340,7 +348,7 @@ function Invoke-IcingaCommand()
|
||||||
);
|
);
|
||||||
|
|
||||||
Import-LocalizedData `
|
Import-LocalizedData `
|
||||||
-BaseDirectory (Join-Path -Path (Get-IcingaFrameworkRootPath) -ChildPath 'icinga-powershell-framework') `
|
-BaseDirectory (Get-IcingaFrameworkRootPath) `
|
||||||
-FileName 'icinga-powershell-framework.psd1' `
|
-FileName 'icinga-powershell-framework.psd1' `
|
||||||
-BindingVariable IcingaFrameworkData;
|
-BindingVariable IcingaFrameworkData;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -91,7 +91,7 @@ function Get-IcingaPowerShellModuleArchive()
|
||||||
'Version' = $Tag;
|
'Version' = $Tag;
|
||||||
'Directory' = '';
|
'Directory' = '';
|
||||||
'Archive' = '';
|
'Archive' = '';
|
||||||
'ModuleRoot' = (Get-IcingaFrameworkRootPath);
|
'ModuleRoot' = (Get-IcingaForWindowsRootPath);
|
||||||
'Installed' = $FALSE;
|
'Installed' = $FALSE;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
@ -107,7 +107,7 @@ function Get-IcingaPowerShellModuleArchive()
|
||||||
'Version' = $Tag;
|
'Version' = $Tag;
|
||||||
'Directory' = '';
|
'Directory' = '';
|
||||||
'Archive' = '';
|
'Archive' = '';
|
||||||
'ModuleRoot' = (Get-IcingaFrameworkRootPath);
|
'ModuleRoot' = (Get-IcingaForWindowsRootPath);
|
||||||
'Installed' = $FALSE;
|
'Installed' = $FALSE;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
@ -131,7 +131,7 @@ function Get-IcingaPowerShellModuleArchive()
|
||||||
'Version' = $Tag;
|
'Version' = $Tag;
|
||||||
'Directory' = $DownloadDirectory;
|
'Directory' = $DownloadDirectory;
|
||||||
'Archive' = $DownloadDestination;
|
'Archive' = $DownloadDestination;
|
||||||
'ModuleRoot' = (Get-IcingaFrameworkRootPath);
|
'ModuleRoot' = (Get-IcingaForWindowsRootPath);
|
||||||
'Installed' = $TRUE;
|
'Installed' = $TRUE;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -45,7 +45,7 @@ function Publish-IcingaPluginConfiguration()
|
||||||
}
|
}
|
||||||
|
|
||||||
if ([string]::IsNullOrEmpty($ComponentPath)) {
|
if ([string]::IsNullOrEmpty($ComponentPath)) {
|
||||||
$ComponentPath = Join-Path -Path (Get-IcingaFrameworkRootPath) -ChildPath ([string]::Format('icinga-powershell-{0}', $ComponentName));
|
$ComponentPath = Join-Path -Path (Get-IcingaForWindowsRootPath) -ChildPath ([string]::Format('icinga-powershell-{0}', $ComponentName));
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((Test-Path $ComponentPath) -eq $FALSE) {
|
if ((Test-Path $ComponentPath) -eq $FALSE) {
|
||||||
|
|
|
||||||
|
|
@ -40,8 +40,8 @@ function Uninstall-IcingaForWindows()
|
||||||
|
|
||||||
$CurrentLocation = Get-Location;
|
$CurrentLocation = Get-Location;
|
||||||
|
|
||||||
if ($CurrentLocation -eq (Join-Path -Path (Get-IcingaFrameworkRootPath) -ChildPath 'icinga-powershell-framework')) {
|
if ($CurrentLocation -eq (Get-IcingaFrameworkRootPath)) {
|
||||||
Set-Location -Path (Get-IcingaFrameworkRootPath);
|
Set-Location -Path (Get-IcingaForWindowsRootPath);
|
||||||
}
|
}
|
||||||
|
|
||||||
Write-IcingaConsoleNotice 'Uninstalling Icinga for Windows from this host';
|
Write-IcingaConsoleNotice 'Uninstalling Icinga for Windows from this host';
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,7 @@ function Uninstall-IcingaFrameworkComponent()
|
||||||
[string]$Name = ''
|
[string]$Name = ''
|
||||||
);
|
);
|
||||||
|
|
||||||
$ModuleBase = Get-IcingaFrameworkRootPath;
|
$ModuleBase = Get-IcingaForWindowsRootPath;
|
||||||
$UninstallComponent = [string]::Format('icinga-powershell-{0}', $Name);
|
$UninstallComponent = [string]::Format('icinga-powershell-{0}', $Name);
|
||||||
$UninstallPath = Join-Path -Path $ModuleBase -ChildPath $UninstallComponent;
|
$UninstallPath = Join-Path -Path $ModuleBase -ChildPath $UninstallComponent;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,7 @@ function Show-IcingaForWindowsManagementConsoleRegisterBackgroundDaemons()
|
||||||
|
|
||||||
$ModuleInfo = $null;
|
$ModuleInfo = $null;
|
||||||
|
|
||||||
Import-LocalizedData -BaseDirectory (Join-Path -Path (Get-IcingaFrameworkRootPath) -ChildPath $module.Name) -FileName ([string]::Format('{0}.psd1', $module.Name)) -BindingVariable ModuleInfo -ErrorAction SilentlyContinue;
|
Import-LocalizedData -BaseDirectory (Join-Path -Path (Get-IcingaForWindowsRootPath) -ChildPath $module.Name) -FileName ([string]::Format('{0}.psd1', $module.Name)) -BindingVariable ModuleInfo -ErrorAction SilentlyContinue;
|
||||||
|
|
||||||
if ($null -eq $ModuleInfo -Or $null -eq $ModuleInfo.PrivateData -Or $null -eq $ModuleInfo.PrivateData.Type -Or ([string]::IsNullOrEmpty($ModuleInfo.PrivateData.Type)) -Or $ModuleInfo.PrivateData.Type -ne 'daemon' -Or $null -eq $ModuleInfo.PrivateData.Function -Or ([string]::IsNullOrEmpty($ModuleInfo.PrivateData.Function))) {
|
if ($null -eq $ModuleInfo -Or $null -eq $ModuleInfo.PrivateData -Or $null -eq $ModuleInfo.PrivateData.Type -Or ([string]::IsNullOrEmpty($ModuleInfo.PrivateData.Type)) -Or $ModuleInfo.PrivateData.Type -ne 'daemon' -Or $null -eq $ModuleInfo.PrivateData.Function -Or ([string]::IsNullOrEmpty($ModuleInfo.PrivateData.Function))) {
|
||||||
continue;
|
continue;
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@ function Write-IcingaConsoleHeader()
|
||||||
[array]$TableHeader = @();
|
[array]$TableHeader = @();
|
||||||
|
|
||||||
Import-LocalizedData `
|
Import-LocalizedData `
|
||||||
-BaseDirectory (Join-Path -Path (Get-IcingaFrameworkRootPath) -ChildPath 'icinga-powershell-framework') `
|
-BaseDirectory (Get-IcingaFrameworkRootPath) `
|
||||||
-FileName 'icinga-powershell-framework.psd1' `
|
-FileName 'icinga-powershell-framework.psd1' `
|
||||||
-BindingVariable IcingaFrameworkData;
|
-BindingVariable IcingaFrameworkData;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue