Fix: Plugin Doc generator file lookup
Fixes a lookup error for existing plugin documentation files, which caused files not being generated properly in case a similar name was already present on the system.
Feature: Moves EventLog out of Application log for IfW
We will move the Icinga for Windows EventLog away from the current \`Application\` log and move it into a custom \`Icinga for Windows\` log, to ensure the \`Application\` log is not spammed with Icinga for Windows events.
Fix: Exception and freezes inside PowerShell ISE session
Fixes Icinga for Windows exception while running \`icinga\` commands or the Icinga Mangement Console inside an \`PowerShell ISE\` session, which behaves differently.
Instead, we now load Icinga for Windows and inform the user about limitations properly.
Fix: Code styling, spelling errors and PSScriptAnalyzer
Fixes lots of code styling, spelling and script analyzer issues.
Disabling UseConsistentIndentation because it is not properly working for multi\-line commands with arguments and array/hashtable objects.
Fix: Removes experimental for API Checks and module requirements
Fixes experimental state of \`API Check\` feature by removing that term and removing the requirement to install \`icinga\-powershell\-restapi\` and \`icinga\-powershell\-apichecks\`
Fix: Icinga Managed User lookup time
Fixes the lookup time if a user is managed by Icinga for Windows or not in large Active Directory environments, by using \`Get\-LocalUser\` instead.
This Cmdlet is available starting with PowerShell 5.0 and later and only required in general for running Icinga for Windows in JEA context. As JEA is only supported starting with PowerShell 5.0 or later, this will not cause any problems.
In case the command is executed on an older system without the \`Get\-LocalUser\` Cmdlet available, Icinga for Windows will handle all users tested with the new implementation as \`not\` managed by Icinga for Windows.
Feature: Adds exception report
Adds a new feature to EventLog writer, allowing to parse an exception report to identity the exact root cause and location, on where the error occurred in first place.
Feature: Allow Force-Creation of certificates for Agent over IMC
Adds support to re\-create the Icinga Agent certificates, even when they are already present on the system. This will resolve the manual requirement to delete the folder or certificates, in case the Icinga CA changes for example
Fix: Sync-IcingaRepository can cause invalid JSON primitive
By using the \`Sync\-IcingaRepository\` function, it might happen that in case the parent site is returning a file listing instead of an error page, the downloaded \*\*repository\*\* file is only the list of the files and not the proper JSON repo file.
Instead we now check the result properly and fallback by adding \`ifw.repo.json\` as it was intended before.
Fix: Version splitting returns "mayor" instead of "major"
Fixes the output value from \`Split\-IcingaVersion\` by returning the object \`major\` in addition to the wrong value \`mayor\`.
We will keep both outputs present for the moment, allowing developers to update their code.
Fix: Username has no length cap for JEA installation
JEA profile installation can fail and cause the Icinga Agent to become defective, in case a username is used being longer than 20 digits.
Fix: Icinga for Windows memory leak
In some scenarios, Icinga for Windows can contain a memory leak, caused by a bug of the Garbage Collector in older PowerShell versions.
We resolve this by enforcing a more aggressive approach on memory cleanup and by collecting all objects being used.
Fix: Performance for Add-Type testing
With recent versions we added a feature to test if Add-Type functions are added to the current PowerShell session, ensuring that the same type is not re-added which caused errors on the error stack.
While the code works perfectly fine, it takes a long time for execution which causes the plugin `Invoke-IcingaCheckDiskHealth` for example, to take way longer than usual.
This PR prepares the future `Private` and `Public` section of the Icinga for Windows environment variables and adds an internal, quick test if a Add-Type function is already added to the current session, once being tested with the old behaviour.
This reduces the disk health plugin execution time after the first run from around 10 seconds to 2 seconds.
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.