icinga-powershell-framework/lib/webserver/Get-IcingaRESTPathElement.psm1
Lord Hepipud 4ef55bddb4 Fixes lots of code styling, spelling and script analyzer
Disabling UseConsistentIndentation because it is not
properly working for multi-line commands with arguments
and array/hashtable objects
2022-01-14 22:26:53 +01:00

21 lines
435 B
PowerShell

function Get-IcingaRESTPathElement()
{
param(
[Hashtable]$Request = @{ },
[int]$Index = 0
);
if ($null -eq $Request -Or $Request.Count -eq 0) {
return '';
}
if ($Request.ContainsKey('RequestPath') -eq $FALSE) {
return '';
}
if (($Index + 1) -gt $Request.RequestPath.PathArray.Count) {
return '';
}
return $Request.RequestPath.PathArray[$Index];
}