-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
icinga -RebuildCache - add option to not start the IMC afterwards #573
Comments
Thank you for the issue. Basically you want to do the following two steps: Invoke-IcingaForWindowsMigration;
Write-IcingaFrameworkCodeCache; This will however not update the current PowerShell instance, as the module is already loaded. Therefor the full handling would be: # Reset all cache files, including installed plugins
Copy-IcingaFrameworkCacheTemplate
# Update Framework Cache
Write-IcingaFrameworkCodeCache;
# Remove the global variable Icinga, to reset possible invalid states
Remove-Variable -Name 'Icinga' -Scope 'Global' -ErrorAction 'SilentlyContinue'
# Re-Import the entire Framework to apply changes
Import-Module 'icinga-powershell-framework' -Force;
Import-Module 'icinga-powershell-framework' -Global -Force;
# Apply migrations
Invoke-IcingaForWindowsMigration; and after that your entire code. We could implement yet another flag doing all these things for the user. but would I'm not sure about a suitable name and the benefit for the moment. Suggestions? |
Good question. For the moment I have also no idea for a suitable name, because If youre create a param like Or you put this code snippset into the docs if somebody like us is needs it also? Because we need this only for two cases:
|
Well, what I mostly do at the moment is something like this icinga -RebuildCache { Write-IcingaConsoleNotice 'Loading Icinga Shell' }; Because you can call ScriptBlocks which just checks if something was set and is executed. A simple |
Thanks, works also fine. Maybe then is a small chapter (e.g. for automation with own tools) in the docs enough?!? |
ref/NC/761567 |
For rebuilding the Code Cache there exists the param
-RebuildCache
. Afterwards the IMC is started. But for automation - like sending this Cmdlet to every/some/many server(s) via WinRM this is not so fine.For this action it would be very helpful if there is an additional option to don't start the IMC or to have an another cmdlet for such tasks.
I saw there exists the cmdlet
Write-IcingaFrameworkCodeCache
but it looks like it doesn't the same. e.g. if you install the PowerShell-moduls manully,icinga -RebuildCache
is also doing some migration tasks if necessaryThe text was updated successfully, but these errors were encountered: