icinga-powershell-framework/lib/webserver/Get-IcingaRESTHeaderValue.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

17 lines
377 B
PowerShell

function Get-IcingaRESTHeaderValue()
{
param(
[hashtable]$Request = @{ },
[string]$Header = $null
);
if ($null -eq $Request -or [string]::IsNullOrEmpty($Header) -Or $Request.Count -eq 0) {
return $null;
}
if ($Request.Header.ContainsKey($Header) -eq $FALSE) {
return $null
}
return $Request.Header[$Header];
}