mirror of
https://github.com/Icinga/icinga-powershell-framework.git
synced 2025-12-20 23:00:35 -05:00
Add function to fetch module root path
This commit is contained in:
parent
2157e151db
commit
5de6344e2c
2 changed files with 9 additions and 1 deletions
|
|
@ -25,7 +25,7 @@ Description = 'Icinga 2 Windows Agent Module, which allows to entirely monitor t
|
|||
PowerShellVersion = '3.0'
|
||||
|
||||
# Aus diesem Modul zu exportierende Funktionen. Um optimale Leistung zu erzielen, verwenden Sie keine Platzhalter und löschen den Eintrag nicht. Verwenden Sie ein leeres Array, wenn keine zu exportierenden Funktionen vorhanden sind.
|
||||
FunctionsToExport = @( 'Use-Icinga', 'Import-IcingaLib', 'Publish-IcingaModuleManifests', 'Get-IcingaPluginDir', 'Get-IcingaCustomPluginDir', 'Get-IcingaCacheDir', 'Get-IcingaPowerShellConfigDir', 'Get-IcingaPowerShellModuleFile' )
|
||||
FunctionsToExport = @( 'Use-Icinga', 'Import-IcingaLib', 'Publish-IcingaModuleManifests', 'Get-IcingaPluginDir', 'Get-IcingaCustomPluginDir', 'Get-IcingaCacheDir', 'Get-IcingaPowerShellConfigDir', 'Get-IcingaFrameworkRootPath', 'Get-IcingaPowerShellModuleFile' )
|
||||
|
||||
# Aus diesem Modul zu exportierende Cmdlets. Um optimale Leistung zu erzielen, verwenden Sie keine Plat'zhalter und löschen den Eintrag nicht. Verwenden Sie ein leeres Array, wenn keine zu exportierenden Cmdlets vorhanden sind.
|
||||
CmdletsToExport = @()
|
||||
|
|
|
|||
|
|
@ -173,6 +173,14 @@ function Get-IcingaPowerShellConfigDir()
|
|||
return (Join-Path -Path $PSScriptRoot -ChildPath 'config');
|
||||
}
|
||||
|
||||
function Get-IcingaFrameworkRootPath()
|
||||
{
|
||||
[string]$Path = $PSScriptRoot;
|
||||
[int]$Index = $Path.LastIndexOf('\') + 1;
|
||||
$Path = $Path.Substring(0, $Index);
|
||||
return $Path;
|
||||
}
|
||||
|
||||
function Get-IcingaPowerShellModuleFile()
|
||||
{
|
||||
return (Join-Path -Path $PSScriptRoot -ChildPath 'icinga-powershell-framework.psm1');
|
||||
|
|
|
|||
Loading…
Reference in a new issue