icinga-powershell-framework/lib/webserver/Get-IcingaRESTPathElement.psm1
Lord Hepipud 3d875639e4 Feature Requests: Add Proxy Server support
Also re-arranges web content by using old content from lib/web into lib/webserver, while new lib/web contains the proxy configuration.
Fixes #19
2020-11-19 17:16:33 +01:00

21 lines
434 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];
}