Fixes code styling, unused variables and function shortnames

This commit is contained in:
Christian Stein 2020-03-24 20:42:11 +01:00
parent aaf4c5faec
commit 691faadf87

View file

@ -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,7 +25,7 @@ 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 );