2022-08-24 03:57:30 -04:00
|
|
|
<#
|
2025-04-22 08:49:21 -04:00
|
|
|
### Note ###
|
2021-08-06 09:44:31 -04:00
|
|
|
|
2025-04-22 08:49:21 -04:00
|
|
|
This file is shipping plain with Icinga for Windows for each version.
|
|
|
|
|
Once the module is loaded, this content will entirely be replaced with
|
|
|
|
|
all modules and components shipped by the Icinga PowerShell Framework.
|
2021-08-06 09:44:31 -04:00
|
|
|
|
2025-04-22 08:49:21 -04:00
|
|
|
Manually enabling the feature is no longer required.
|
2021-08-06 09:44:31 -04:00
|
|
|
#>
|
|
|
|
|
|
2025-04-22 08:49:21 -04:00
|
|
|
# Ensure we only load this module once
|
|
|
|
|
if ($null -ne $Global:Icinga -And $Global:Icinga.ContainsKey('CacheBuilding') -And $Global:Icinga['CacheBuilding']) {
|
|
|
|
|
return;
|
2025-04-22 06:04:41 -04:00
|
|
|
}
|
|
|
|
|
|
2025-04-22 08:49:21 -04:00
|
|
|
if ($null -eq $Global:Icinga) {
|
|
|
|
|
$Global:Icinga = @{ };
|
2025-04-22 06:04:41 -04:00
|
|
|
}
|
|
|
|
|
|
2025-04-22 08:49:21 -04:00
|
|
|
if ($Global:Icinga.ContainsKey('CacheBuilding') -eq $FALSE) {
|
|
|
|
|
$Global:Icinga.Add('CacheBuilding', $TRUE);
|
|
|
|
|
} else {
|
|
|
|
|
$Global:Icinga.CacheBuilding = $TRUE;
|
2025-04-22 06:04:41 -04:00
|
|
|
}
|
|
|
|
|
|
2025-04-22 08:49:21 -04:00
|
|
|
# Ensures that VS Code is not generating the cache file
|
|
|
|
|
if ($null -ne $env:TERM_PROGRAM) {
|
|
|
|
|
Write-IcingaFrameworkCodeCache -DeveloperMode;
|
|
|
|
|
return;
|
2022-05-24 07:11:25 -04:00
|
|
|
}
|
|
|
|
|
|
2025-04-22 08:49:21 -04:00
|
|
|
Write-IcingaFrameworkCodeCache;
|
2021-08-06 12:12:27 -04:00
|
|
|
|
2025-04-22 08:49:21 -04:00
|
|
|
Import-Module icinga-powershell-framework -Global -Force;
|
|
|
|
|
Import-Module icinga-powershell-framework -Force;
|
2022-05-24 07:11:25 -04:00
|
|
|
|
2025-04-22 08:49:21 -04:00
|
|
|
if ($null -ne $env:TERM_PROGRAM -Or $Global:Icinga.Protected.DeveloperMode) {
|
|
|
|
|
Copy-IcingaFrameworkCacheTemplate;
|
2022-05-24 07:11:25 -04:00
|
|
|
}
|
2023-05-09 06:57:40 -04:00
|
|
|
|
2025-04-22 08:49:21 -04:00
|
|
|
$Global:Icinga.CacheBuilding = $FALSE;
|