Fix framework loading instead of cache

This commit is contained in:
Lord Hepipud 2021-08-06 16:43:42 +02:00
parent 2583e82102
commit 62bcbe5553
2 changed files with 5 additions and 49 deletions

View file

@ -7,51 +7,8 @@
Copyright = '(c) 2021 Icinga GmbH | MIT' Copyright = '(c) 2021 Icinga GmbH | MIT'
Description = 'Icinga for Windows module which allows to entirely monitor the Windows Host system.' Description = 'Icinga for Windows module which allows to entirely monitor the Windows Host system.'
PowerShellVersion = '4.0' PowerShellVersion = '4.0'
NestedModules = @( NestedModules = @( '.\cache\framework_cache.psm1' )
'.\cache\framework_cache.psm1' FunctionsToExport = @( '*' )
)
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 = @( '*' ) CmdletsToExport = @( '*' )
VariablesToExport = '*' VariablesToExport = '*'
AliasesToExport = @( 'icinga' ) AliasesToExport = @( 'icinga' )

View file

@ -18,8 +18,7 @@ function Use-Icinga()
); );
if ($null -ne $Global:Icinga -And $Global:Icinga.ContainsKey('RebuildCache') -And $Global:Icinga.RebuildCache) { if ($null -ne $Global:Icinga -And $Global:Icinga.ContainsKey('RebuildCache') -And $Global:Icinga.RebuildCache) {
Remove-Module 'icinga-powershell-framework'; Import-Module 'icinga-powershell-framework' -Global -Force;
Import-Module (Get-IcingaFrameworkCodeCacheFile) -Global -Force;
} }
Disable-IcingaProgressPreference; Disable-IcingaProgressPreference;
@ -137,7 +136,7 @@ function Import-IcingaLib()
$CacheFile = Get-IcingaFrameworkCodeCacheFile; $CacheFile = Get-IcingaFrameworkCodeCacheFile;
if ($Custom -eq $FALSE -And $CompileCache -eq $FALSE -And (Test-Path $CacheFile)) { if ($Custom -eq $FALSE -And $CompileCache -eq $FALSE -And (Test-Path $CacheFile)) {
Import-Module $CacheFile -Global; Import-Module 'icinga-powershell-framework' -Global -Force;
return; return;
} }