diff --git a/icinga-powershell-framework.psd1 b/icinga-powershell-framework.psd1 index 236f170..86f8eed 100644 --- a/icinga-powershell-framework.psd1 +++ b/icinga-powershell-framework.psd1 @@ -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 = @() diff --git a/icinga-powershell-framework.psm1 b/icinga-powershell-framework.psm1 index 9cfdf0f..cb5181f 100644 --- a/icinga-powershell-framework.psm1 +++ b/icinga-powershell-framework.psm1 @@ -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');