Fix: Removes unnecessary module import
Removes not required import of PowerShell modules for `Invoke-IcingaNamespaceCmdlets`, as by the time we fetch the content the specified module must be loaded already.
In addition adds proper error output in case something goes wrong. Errors are written directly into the EventLog.
Fix: Memory leak on EventLog reader
With Icinga for Windows v1.7.0 we introdocued a way to read EventLog entries as stream directly into the CLI.
If used for a long time, the memory consumption of this active shell will increase over time, as the Garbage Collector does not kick in.
This will fix the issue by forcing the GC to be called after each loop cycle.
Fix: Repo hash generator causes file hashes to never compare
Fixes repository file hash generator, which now only includes .zip and .msi files, which otherwise turned into invalid hashes because of the repository index file always changing based on the assigned hash, resulting in a different repository hash
Fix: Repository Manager is not using Icinga Web-Requests
Fixes the repository manager by now using Icinga WebRequests instead of Windows WebRequests, allowing the usage of the internal proxy feature.
Fix: Removes String.Builder output while creating new components
Fixes String.Builder object output, while creating new components by using `New-IcingaForWindowsComponent`
Fix: ThresholdInterval data type in plugin docs
Fixes `-ThresholdInterval` data type inside auto generated docs for plugins, which was of type `Object`, but should be of type `String`
Feature: Adds function to create plugin documentation
Adds new function `Publish-IcingaPluginDocumentation` which was previously only available within the plugins package.
Feature: Adds developer tools for easier start and management
Adds additional Cmdlets to get working on new Icinga for Windows components and publishing of modules including validation alot easier.
`New-IcingaForWindowsComponent`: Creates an entire new module structure depending on input values, to get a base skeleton for further development ready
`Publish-IcingaForWindowsComponent`: Properly adds documentation, possible plugin configuration and dependencies of files to the manifest file, ensuring the integrity of the module
`Test-IcingaForWindowsComponent`: Allows to test your module and checks for code styling issues and errors as well as testing the module itself, if it can be imported, printing errors in case of problems
`Open-IcingaForWindowsComponentInEditor`: Allows to open a certain Icinga for Windows component in an editor to get started a lot easier. Only supports `Visual Studio Code` at the moment
Feature: Adds generic EventLog reader and IfW reader
Adds generic reader function `Read-IcingaWindowsEventLog`, allowing to read any EventLog as stream on the console and adds in addition `Read-IcingaForWindowsLog` for reading Icinga for Windows specific logs
Feature: Adds support to read EventLog for logs
Starting with Icinga 2.13.0, the Agent will write to the Windows EventLog by default. Our `Read-IcingaAgentLogFile` Cmdlet will now support both and read from the EventLog if the feature is enabled and 2.13.0 or later is being installed
Fix: Thershold interval time conversion
Fixes an issue with `-ThresholdInterval` unit conversion, which causes an error if you want to convert `60m` or `1h`, as the used object is returning 0 for minutes in this matter, as the object itself moved to hours instead.
We should use `TotalMinutes` instead of `Minutes` on our `TimeSpan` object and round every single value returned to 0 digits.
Fix: Use alias for args name on config generation
In case we are using aliases for command arguments/parameters, we should always use the first alias we find as argument instead of using the real name.
Fix: Check command generator for aliases
In case we are using aliases for check commands, to keep backwards compatibility, we have to ensure that check commands actually use the name of the alias for custom variables, to not break the naming and prevent wrong usage of custom variables.
Fix: Module not loaded exception
Fixes an exception, telling the user a module is not loaded or installed, while the check itself returned a false value.
However, this check in general is useless and should be removed, as we can only check for components being loaded already, making it impossible to verify that a command is not available and loading the corresponding module, as we are unable to detect which module belongs to the command.
Therefor the entire test for this just causes CPU overhead and loading time for nothing.
Feature: Move REST-Api and Aoi-Checks into Framework
As the long-term goal will be to move away from check execution with local PowerShell instances, we move the REST-Api and Api-Checks feature directly into the Framework.
By adding everything directly into the Framework, we ensure that no side-loading of modules is required and we can use the API and checker features to increase performance by a lot and provide direct setup and installation procedures inside the IMC.
Fix: IMC error handling on invalid JSON for install command/file
Fixes error handling for IMC on automated installation with installation command or answer file, which will not abort the installation in case invalid JSON is provided or commands are used inside the command, not valid or exist on the system.
The system will write an error message and abort the installation in case of initial errors now.
Fix: Exception on last uninstall message print
Fixes an exception on the last message output while running `Uninstall-IcingaForWindows`, as the used function is no longer available due to Framework uninstallation.
We now replaced the last messages with proper `Write-Host` output
Fix: Repository names with dots fail to load
Fixes repository names with dots (`.`) by replacing them with `-`, as otherwise the config parser will fail finding the config object
Fix: IMC summary header has misleading title
Fixes misleading title for IMC summary header, which implies the installation instantly starts on continue, instead of notifying properly about the installation being started on the next step including the export of the answer file and install command.