Add support to test for available functions

This commit is contained in:
Lord Hepipud 2019-10-22 19:19:57 +02:00
parent fd470db9e2
commit 0d59fc9a15

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;
}