mirror of
https://github.com/Icinga/icinga-powershell-framework.git
synced 2025-12-21 07:10:15 -05:00
30 lines
735 B
PowerShell
30 lines
735 B
PowerShell
<#
|
|
.SYNOPSIS
|
|
Test if a config entry on an object is already present
|
|
.DESCRIPTION
|
|
Test if a config entry on an object is already present
|
|
.FUNCTIONALITY
|
|
Test if a config entry on an object is already present
|
|
.EXAMPLE
|
|
PS>Test-IcingaPowerShellConfigItem -ConfigObject $PSObject -ConfigKey 'keyname';
|
|
.PARAMETER ConfigObject
|
|
The custom config object to check for
|
|
.PARAMETER ConfigKey
|
|
The key which is checked
|
|
.INPUTS
|
|
System.String
|
|
.OUTPUTS
|
|
System.Boolean
|
|
.LINK
|
|
https://github.com/Icinga/icinga-powershell-framework
|
|
#>
|
|
|
|
function Test-IcingaPowerShellConfigItem()
|
|
{
|
|
param(
|
|
$ConfigObject,
|
|
$ConfigKey
|
|
);
|
|
|
|
return ([bool]($ConfigObject.PSobject.Properties.Name -eq $ConfigKey) -eq $TRUE);
|
|
}
|