From 3e5a97d52b6984cd4f4da137e52c953352a5529e Mon Sep 17 00:00:00 2001 From: Christian Stein Date: Tue, 4 Aug 2020 15:13:04 +0200 Subject: [PATCH] Fix assignment indentation for variables/objects --- icinga-powershell-framework.psd1 | 30 ++++++++-------- .../ConvertTo-IcingaIPv4BinaryString.psm1 | 2 +- .../ConvertTo-IcingaIPv6BinaryString.psm1 | 2 +- .../tools/Get-IcingaCheckCommandConfig.psm1 | 18 +++++----- .../tools/Get-IcingaNetworkInterface.psm1 | 4 +-- lib/core/tools/Get-IcingaServices.psm1 | 36 +++++++++---------- lib/icinga/enums/Icinga_IcingaEnums.psm1 | 8 ++--- .../Icinga_IcingaExceptionEnums.psm1 | 20 +++++------ 8 files changed, 60 insertions(+), 60 deletions(-) diff --git a/icinga-powershell-framework.psd1 b/icinga-powershell-framework.psd1 index 9173932..6234e50 100644 --- a/icinga-powershell-framework.psd1 +++ b/icinga-powershell-framework.psd1 @@ -1,11 +1,11 @@ @{ - RootModule = 'icinga-powershell-framework.psm1' - ModuleVersion = '1.2.0' - GUID = 'fcd7a805-a41b-49f9-afee-9d17a2b76d42' - Author = 'Lord Hepipud' - CompanyName = 'Icinga GmbH' - Copyright = '(c) 2020 Icinga GmbH | MIT' - Description = 'Icinga for Windows module which allows to entirely monitor the Windows Host system.' + RootModule = 'icinga-powershell-framework.psm1' + ModuleVersion = '1.2.0' + GUID = 'fcd7a805-a41b-49f9-afee-9d17a2b76d42' + Author = 'Lord Hepipud' + CompanyName = 'Icinga GmbH' + Copyright = '(c) 2020 Icinga GmbH | MIT' + Description = 'Icinga for Windows module which allows to entirely monitor the Windows Host system.' PowerShellVersion = '4.0' FunctionsToExport = @( 'Use-Icinga', @@ -20,17 +20,17 @@ 'Get-IcingaFrameworkRootPath', 'Get-IcingaPowerShellModuleFile' ) - CmdletsToExport = @() + CmdletsToExport = @() VariablesToExport = '*' - AliasesToExport = @( 'icinga' ) - PrivateData = @{ - PSData = @{ - Tags = @( 'icinga', 'icinga2', 'IcingaPowerShellFramework', 'IcingaPowerShell', 'IcingaforWindows', 'IcingaWindows') - LicenseUri = 'https://github.com/Icinga/icinga-powershell-framework/blob/master/LICENSE' - ProjectUri = 'https://github.com/Icinga/icinga-powershell-framework' + AliasesToExport = @( 'icinga' ) + PrivateData = @{ + PSData = @{ + Tags = @( 'icinga', 'icinga2', 'IcingaPowerShellFramework', 'IcingaPowerShell', 'IcingaforWindows', 'IcingaWindows') + LicenseUri = 'https://github.com/Icinga/icinga-powershell-framework/blob/master/LICENSE' + ProjectUri = 'https://github.com/Icinga/icinga-powershell-framework' ReleaseNotes = 'https://github.com/Icinga/icinga-powershell-framework/releases' }; Version = 'v1.2.0'; } - HelpInfoURI = 'https://github.com/Icinga/icinga-powershell-framework' + HelpInfoURI = 'https://github.com/Icinga/icinga-powershell-framework' } diff --git a/lib/core/tools/ConvertTo-IcingaIPv4BinaryString.psm1 b/lib/core/tools/ConvertTo-IcingaIPv4BinaryString.psm1 index ddf781e..b46c1cf 100644 --- a/lib/core/tools/ConvertTo-IcingaIPv4BinaryString.psm1 +++ b/lib/core/tools/ConvertTo-IcingaIPv4BinaryString.psm1 @@ -39,6 +39,6 @@ function ConvertTo-IcingaIPv4BinaryString() return @{ 'value' = $IP; - 'name' = 'IPv4' + 'name' = 'IPv4' } } diff --git a/lib/core/tools/ConvertTo-IcingaIPv6BinaryString.psm1 b/lib/core/tools/ConvertTo-IcingaIPv6BinaryString.psm1 index 88b5536..836212a 100644 --- a/lib/core/tools/ConvertTo-IcingaIPv6BinaryString.psm1 +++ b/lib/core/tools/ConvertTo-IcingaIPv6BinaryString.psm1 @@ -36,6 +36,6 @@ function ConvertTo-IcingaIPv6BinaryString() return @{ 'value' = $IP; - 'name' = 'IPv6' + 'name' = 'IPv6' } } diff --git a/lib/core/tools/Get-IcingaCheckCommandConfig.psm1 b/lib/core/tools/Get-IcingaCheckCommandConfig.psm1 index 2bdd788..d8b2a9d 100644 --- a/lib/core/tools/Get-IcingaCheckCommandConfig.psm1 +++ b/lib/core/tools/Get-IcingaCheckCommandConfig.psm1 @@ -150,9 +150,9 @@ function Get-IcingaCheckCommandConfig() if ($parameter.type.name -eq 'SwitchParameter') { $Basket.Command[$Data.Name].arguments.Add( [string]::Format('-{0}', $parameter.Name), @{ - 'set_if' = $IcingaCustomVariable; + 'set_if' = $IcingaCustomVariable; 'set_if_format' = 'string'; - 'order' = $Order; + 'order' = $Order; } ); @@ -236,21 +236,21 @@ function Get-IcingaCheckCommandConfig() if ($Basket.Datafield.Values.varname -ne $IcingaCustomVariable) { $Basket.Datafield.Add( [string]$FieldID, @{ - 'varname' = $IcingaCustomVariable; - 'caption' = $parameter.Name; + 'varname' = $IcingaCustomVariable; + 'caption' = $parameter.Name; 'description' = $parameter.Description.Text; - 'datatype' = $IcingaDataType; - 'format' = $NULL; - 'originalId' = [string]$FieldID; + 'datatype' = $IcingaDataType; + 'format' = $NULL; + 'originalId' = [string]$FieldID; } ); if ($IsDataList) { $Basket.Datafield[[string]$FieldID].Add( 'settings', @{ - 'datalist' = $DataListName; + 'datalist' = $DataListName; 'data_type' = 'string'; - 'behavior' = 'strict'; + 'behavior' = 'strict'; } ); } else { diff --git a/lib/core/tools/Get-IcingaNetworkInterface.psm1 b/lib/core/tools/Get-IcingaNetworkInterface.psm1 index 7f04e1a..e06a918 100644 --- a/lib/core/tools/Get-IcingaNetworkInterface.psm1 +++ b/lib/core/tools/Get-IcingaNetworkInterface.psm1 @@ -91,8 +91,8 @@ function Get-IcingaNetworkInterface() $InterfaceData.Add( $Key, @{ 'Binary IP String' = (ConvertTo-IcingaIPBinaryString -IP $IP).value; - 'Mask' = $Mask; - 'Interface' = $Info.ifIndex; + 'Mask' = $Mask; + 'Interface' = $Info.ifIndex; } ); } diff --git a/lib/core/tools/Get-IcingaServices.psm1 b/lib/core/tools/Get-IcingaServices.psm1 index 3b6ff7a..c5e7dff 100644 --- a/lib/core/tools/Get-IcingaServices.psm1 +++ b/lib/core/tools/Get-IcingaServices.psm1 @@ -57,34 +57,34 @@ function Get-IcingaServices() $ServiceData.Add( $service.Name, @{ - 'metadata' = @{ - 'DisplayName' = $service.DisplayName; - 'ServiceName' = $service.ServiceName; - 'Site' = $service.Site; - 'Container' = $service.Container; + 'metadata' = @{ + 'DisplayName' = $service.DisplayName; + 'ServiceName' = $service.ServiceName; + 'Site' = $service.Site; + 'Container' = $service.Container; 'ServiceHandle' = $service.ServiceHandle; - 'Dependent' = $DependentServices; - 'Depends' = $DependingServices; + 'Dependent' = $DependentServices; + 'Depends' = $DependingServices; }; 'configuration' = @{ 'CanPauseAndContinue' = $service.CanPauseAndContinue; - 'CanShutdown' = $service.CanShutdown; - 'CanStop' = $service.CanStop; - 'Status' = @{ - 'raw' = [int]$service.Status; + 'CanShutdown' = $service.CanShutdown; + 'CanStop' = $service.CanStop; + 'Status' = @{ + 'raw' = [int]$service.Status; 'value' = $service.Status; }; - 'ServiceType' = @{ - 'raw' = [int]$service.ServiceType; + 'ServiceType' = @{ + 'raw' = [int]$service.ServiceType; 'value' = $service.ServiceType; }; - 'ServiceHandle' = $service.ServiceHandle; - 'StartType' = @{ - 'raw' = [int]$service.StartType; + 'ServiceHandle' = $service.ServiceHandle; + 'StartType' = @{ + 'raw' = [int]$service.StartType; 'value' = $service.StartType; }; - 'ServiceUser' = $ServiceUser; - 'ExitCode' = $ServiceExitCode; + 'ServiceUser' = $ServiceUser; + 'ExitCode' = $ServiceExitCode; } } ); diff --git a/lib/icinga/enums/Icinga_IcingaEnums.psm1 b/lib/icinga/enums/Icinga_IcingaEnums.psm1 index 1b11ac1..00951f0 100644 --- a/lib/icinga/enums/Icinga_IcingaEnums.psm1 +++ b/lib/icinga/enums/Icinga_IcingaEnums.psm1 @@ -5,10 +5,10 @@ #> [hashtable]$IcingaExitCode = @{ - Ok = 0; - Warning = 1; - Critical = 2; - Unknown = 3; + Ok = 0; + Warning = 1; + Critical = 2; + Unknown = 3; }; [hashtable]$IcingaExitCodeText = @{ diff --git a/lib/icinga/exception/Icinga_IcingaExceptionEnums.psm1 b/lib/icinga/exception/Icinga_IcingaExceptionEnums.psm1 index 57e1726..3a823eb 100644 --- a/lib/icinga/exception/Icinga_IcingaExceptionEnums.psm1 +++ b/lib/icinga/exception/Icinga_IcingaExceptionEnums.psm1 @@ -5,19 +5,19 @@ #> [hashtable]$Permission = @{ - PerformanceCounter = 'A Plugin failed to fetch Performance Counter information. This may be caused when the used Service User is not permitted to access these information. To fix this, please add the User the Icinga Agent is running on into the "Performance Log Users" group and restart the service.'; - CacheFolder = "A plugin failed to write new data into the configured cache directory. Please update the permissions of this folder to allow write access for the user the Icinga Service is running with or use another folder as cache directory."; - CimInstance = 'The user you are running this command as does not have permission to access the requested Cim-Object. To fix this, please add the user the Agent is running with to the "Remote Management Users" groups and grant access to the WMI branch "root/cimv2" and add the permission "Remote enable".'; - WMIObject = 'The user you are running this command as does not have permission to access the requested Wmi-Object. To fix this, please add the user the Agent is running with to the "Remote Management Users" groups and grant access to the WMI branch "root/cimv2" and add the permission "Remote enable".'; + PerformanceCounter = 'A Plugin failed to fetch Performance Counter information. This may be caused when the used Service User is not permitted to access these information. To fix this, please add the User the Icinga Agent is running on into the "Performance Log Users" group and restart the service.'; + CacheFolder = "A plugin failed to write new data into the configured cache directory. Please update the permissions of this folder to allow write access for the user the Icinga Service is running with or use another folder as cache directory."; + CimInstance = 'The user you are running this command as does not have permission to access the requested Cim-Object. To fix this, please add the user the Agent is running with to the "Remote Management Users" groups and grant access to the WMI branch "root/cimv2" and add the permission "Remote enable".'; + WMIObject = 'The user you are running this command as does not have permission to access the requested Wmi-Object. To fix this, please add the user the Agent is running with to the "Remote Management Users" groups and grant access to the WMI branch "root/cimv2" and add the permission "Remote enable".'; }; [hashtable]$Inputs = @{ - PerformanceCounter = 'A plugin failed to fetch Performance Counter information. Please ensure the counter is written properly and available on your system.'; - EventLogLogName = 'Failed to fetch EventLog information. Please specify a valid LogName.'; - EventLog = 'Failed to fetch EventLog information. Please check your inputs for EntryTypes and other categories and try again.'; - ConversionUnitMissing = 'Unable to parse input value. You have to add an unit to your input value. Example: "10GB". Allowed units are: "B, KB, MB, GB, TB, PB, KiB, MiB, GiB, TiB, PiB".'; - CimClassNameUnknown = 'The provided class name you try to fetch with Get-CimInstance is not known on this system.'; - WmiObjectClassUnknown = 'The provided class name you try to fetch with Get-WmiObject is not known on this system.'; + PerformanceCounter = 'A plugin failed to fetch Performance Counter information. Please ensure the counter is written properly and available on your system.'; + EventLogLogName = 'Failed to fetch EventLog information. Please specify a valid LogName.'; + EventLog = 'Failed to fetch EventLog information. Please check your inputs for EntryTypes and other categories and try again.'; + ConversionUnitMissing = 'Unable to parse input value. You have to add an unit to your input value. Example: "10GB". Allowed units are: "B, KB, MB, GB, TB, PB, KiB, MiB, GiB, TiB, PiB".'; + CimClassNameUnknown = 'The provided class name you try to fetch with Get-CimInstance is not known on this system.'; + WmiObjectClassUnknown = 'The provided class name you try to fetch with Get-WmiObject is not known on this system.'; }; [hashtable]$Configuration = @{