From 691faadf8735d860b9aa0fbe8fa3b59f4685db57 Mon Sep 17 00:00:00 2001 From: Christian Stein Date: Tue, 24 Mar 2020 20:42:11 +0100 Subject: [PATCH] Fixes code styling, unused variables and function shortnames --- lib/web/Read-IcingaRESTMessage.psm1 | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/web/Read-IcingaRESTMessage.psm1 b/lib/web/Read-IcingaRESTMessage.psm1 index ffed571..496c4df 100644 --- a/lib/web/Read-IcingaRESTMessage.psm1 +++ b/lib/web/Read-IcingaRESTMessage.psm1 @@ -15,8 +15,7 @@ function Read-IcingaRESTMessage() #Path $PathMatch = $Matches[3]; - $PathMatch -match '(.+)\?(.*)' | Out-Null - $Path = $Matches[1]; + $PathMatch -match '(.+)\?(.*)' | Out-Null; $Arguments = $Matches[2]; $Request.RequestPath.Add('FullPath', $Matches[1]); $Request.RequestPath.Add('PathArray', $Matches[1].TrimStart('/').Split('/')); @@ -26,14 +25,14 @@ function Read-IcingaRESTMessage() # Arguments $ArgumentsSplit = $Arguments.Split('&'); $ArgumentsSplit+='\\\\\\\\\\\\=FIN'; - foreach ( $Argument in $ArgumentsSplit | sort -descending) { + foreach ( $Argument in $ArgumentsSplit | Sort-Object -descending) { $Argument -match '(.+)=(.+)' | Out-Null; If (($Matches[1] -ne $Current) -And ($NULL -ne $Current)) { $Request.RequestArguments.Add( $Current, $ArgumentContent ); [array]$ArgumentContent = $null; } $Current = $Matches[1]; - [array]$ArgumentContent+=($Matches[2]); + [array]$ArgumentContent += ($Matches[2]); } # Header