mirror of
https://github.com/Icinga/icinga-powershell-framework.git
synced 2025-12-21 07:10:15 -05:00
Fixes code styling, unused variables and function shortnames
This commit is contained in:
parent
aaf4c5faec
commit
691faadf87
1 changed files with 3 additions and 4 deletions
|
|
@ -15,8 +15,7 @@ function Read-IcingaRESTMessage()
|
||||||
|
|
||||||
#Path
|
#Path
|
||||||
$PathMatch = $Matches[3];
|
$PathMatch = $Matches[3];
|
||||||
$PathMatch -match '(.+)\?(.*)' | Out-Null
|
$PathMatch -match '(.+)\?(.*)' | Out-Null;
|
||||||
$Path = $Matches[1];
|
|
||||||
$Arguments = $Matches[2];
|
$Arguments = $Matches[2];
|
||||||
$Request.RequestPath.Add('FullPath', $Matches[1]);
|
$Request.RequestPath.Add('FullPath', $Matches[1]);
|
||||||
$Request.RequestPath.Add('PathArray', $Matches[1].TrimStart('/').Split('/'));
|
$Request.RequestPath.Add('PathArray', $Matches[1].TrimStart('/').Split('/'));
|
||||||
|
|
@ -26,14 +25,14 @@ function Read-IcingaRESTMessage()
|
||||||
# Arguments
|
# Arguments
|
||||||
$ArgumentsSplit = $Arguments.Split('&');
|
$ArgumentsSplit = $Arguments.Split('&');
|
||||||
$ArgumentsSplit+='\\\\\\\\\\\\=FIN';
|
$ArgumentsSplit+='\\\\\\\\\\\\=FIN';
|
||||||
foreach ( $Argument in $ArgumentsSplit | sort -descending) {
|
foreach ( $Argument in $ArgumentsSplit | Sort-Object -descending) {
|
||||||
$Argument -match '(.+)=(.+)' | Out-Null;
|
$Argument -match '(.+)=(.+)' | Out-Null;
|
||||||
If (($Matches[1] -ne $Current) -And ($NULL -ne $Current)) {
|
If (($Matches[1] -ne $Current) -And ($NULL -ne $Current)) {
|
||||||
$Request.RequestArguments.Add( $Current, $ArgumentContent );
|
$Request.RequestArguments.Add( $Current, $ArgumentContent );
|
||||||
[array]$ArgumentContent = $null;
|
[array]$ArgumentContent = $null;
|
||||||
}
|
}
|
||||||
$Current = $Matches[1];
|
$Current = $Matches[1];
|
||||||
[array]$ArgumentContent+=($Matches[2]);
|
[array]$ArgumentContent += ($Matches[2]);
|
||||||
}
|
}
|
||||||
|
|
||||||
# Header
|
# Header
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue