diff --git a/icinga-powershell-framework.psd1 b/icinga-powershell-framework.psd1 index 157e7f0f..12472e71 100644 --- a/icinga-powershell-framework.psd1 +++ b/icinga-powershell-framework.psd1 @@ -7,52 +7,9 @@ Copyright = '(c) 2021 Icinga GmbH | MIT' Description = 'Icinga for Windows module which allows to entirely monitor the Windows Host system.' PowerShellVersion = '4.0' - NestedModules = @( - '.\cache\framework_cache.psm1' - ) - FunctionsToExport = @( - 'Use-Icinga', - 'Invoke-IcingaCommand', - 'Import-IcingaLib', - 'Get-IcingaFrameworkCodeCacheFile', - 'Write-IcingaFrameworkCodeCache', - 'Publish-IcingaModuleManifest', - 'Publish-IcingaEventlogDocumentation', - 'Get-IcingaPluginDir', - 'Get-IcingaCustomPluginDir', - 'Get-IcingaCacheDir', - 'Get-IcingaPowerShellConfigDir', - 'Get-IcingaFrameworkRootPath', - 'Get-IcingaForWindowsRootPath', - 'Get-IcingaPowerShellModuleFile', - 'Start-IcingaShellAsUser', - 'Get-IcingaPowerShellConfig', - 'Read-IcingaPowerShellConfig', - 'Test-IcingaPowerShellConfigItem', - 'Write-IcingaConsoleOutput', - 'Write-IcingaConsoleNotice', - 'Write-IcingaConsoleWarning', - 'Read-IcingaFileContent', - 'Invoke-IcingaInternalServiceCall', - 'Get-IcingaFrameworkApiChecks', - 'Get-IcingaBackgroundDaemons', - 'Enable-IcingaUntrustedCertificateValidation', - 'Write-IcingaEventMessage', - 'Exit-IcingaExecutePlugin', - 'Exit-IcingaPluginNotInstalled', - 'Exit-IcingaThrowException', - 'Set-IcingaTLSVersion', - 'Disable-IcingaProgressPreference', - 'New-IcingaNewLine', - 'Write-IcingaConsolePlain', - 'Test-IcingaFunction', - 'Write-IcingaConsoleHeader', - 'Test-IcingaFrameworkConsoleOutput', - 'ConvertTo-IcingaSecureString', - 'ConvertTo-JsonUTF8Bytes', - 'ConvertFrom-JsonUTF8' - ) - CmdletsToExport = @('*') + NestedModules = @( '.\cache\framework_cache.psm1' ) + FunctionsToExport = @( '*' ) + CmdletsToExport = @( '*' ) VariablesToExport = '*' AliasesToExport = @( 'icinga' ) PrivateData = @{ diff --git a/icinga-powershell-framework.psm1 b/icinga-powershell-framework.psm1 index 80fb272d..eda41528 100644 --- a/icinga-powershell-framework.psm1 +++ b/icinga-powershell-framework.psm1 @@ -18,8 +18,7 @@ function Use-Icinga() ); if ($null -ne $Global:Icinga -And $Global:Icinga.ContainsKey('RebuildCache') -And $Global:Icinga.RebuildCache) { - Remove-Module 'icinga-powershell-framework'; - Import-Module (Get-IcingaFrameworkCodeCacheFile) -Global -Force; + Import-Module 'icinga-powershell-framework' -Global -Force; } Disable-IcingaProgressPreference; @@ -137,7 +136,7 @@ function Import-IcingaLib() $CacheFile = Get-IcingaFrameworkCodeCacheFile; if ($Custom -eq $FALSE -And $CompileCache -eq $FALSE -And (Test-Path $CacheFile)) { - Import-Module $CacheFile -Global; + Import-Module 'icinga-powershell-framework' -Global -Force; return; }