mirror of
https://github.com/Icinga/icinga-powershell-framework.git
synced 2025-12-21 15:19:58 -05:00
24 lines
445 B
PowerShell
24 lines
445 B
PowerShell
function Add-IcingaHashtableItem()
|
|
{
|
|
param(
|
|
$Hashtable,
|
|
$Key,
|
|
$Value,
|
|
[switch]$Override
|
|
);
|
|
|
|
if ($null -eq $Hashtable) {
|
|
return $FALSE;
|
|
}
|
|
|
|
if ($Hashtable.ContainsKey($Key) -eq $FALSE) {
|
|
$Hashtable.Add($Key, $Value);
|
|
return $TRUE;
|
|
} else {
|
|
if ($Override) {
|
|
$Hashtable[$Key] = $Value;
|
|
return $TRUE;
|
|
}
|
|
}
|
|
return $FALSE;
|
|
}
|