Add support to test for available functions

This commit is contained in:
Lord Hepipud 2019-10-22 19:19:57 +02:00
parent 243e213a84
commit 30811a1dee

View file

@ -0,0 +1,16 @@
function Test-IcingaFunction()
{
param(
[string]$Name
);
if ([string]::IsNullOrEmpty($Name)) {
return $FALSE;
}
if (Get-Command $Name -ErrorAction SilentlyContinue) {
return $TRUE;
}
return $FALSE;
}