mirror of
https://github.com/Icinga/icinga-powershell-framework.git
synced 2025-12-21 07:10:15 -05:00
Add support to test for available functions
This commit is contained in:
parent
243e213a84
commit
30811a1dee
1 changed files with 16 additions and 0 deletions
16
lib/core/tools/Test-IcingaFunction.psm1
Normal file
16
lib/core/tools/Test-IcingaFunction.psm1
Normal 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;
|
||||
}
|
||||
Loading…
Reference in a new issue