mirror of
https://github.com/Icinga/icinga-powershell-framework.git
synced 2025-12-21 07:10:15 -05:00
22 lines
435 B
PowerShell
22 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];
|
||
|
|
}
|