Added basic generic tool collection

This commit is contained in:
Lord Hepipud 2019-07-19 19:35:08 +02:00
parent fafb102f0d
commit ae62c4a7ce
3 changed files with 23 additions and 0 deletions

1
lib/core/tools.psm1 Normal file
View file

@ -0,0 +1 @@
Import-IcingaDirectoryModules -LibDirectory (Join-Path -Path $PSScriptRoot -ChildPath $MyInvocation.MyCommand.Name) -ForceReload;

View file

@ -0,0 +1,19 @@
function New-StringTree()
{
param(
[int]$Spacing
)
if ($Spacing -eq 0) {
return '';
}
[string]$spaces = ' \_ ';
while ($Spacing -gt 1) {
$Spacing -= 1;
$spaces = ' ' + $spaces;
}
return $spaces;
}

View file

@ -0,0 +1,3 @@
function Test-Numeric ($number) {
return $number -Match "^[\d\.]+$";
}