mirror of
https://github.com/Icinga/icinga-powershell-framework.git
synced 2025-12-20 23:00:35 -05:00
Added basic generic tool collection
This commit is contained in:
parent
fafb102f0d
commit
ae62c4a7ce
3 changed files with 23 additions and 0 deletions
1
lib/core/tools.psm1
Normal file
1
lib/core/tools.psm1
Normal file
|
|
@ -0,0 +1 @@
|
|||
Import-IcingaDirectoryModules -LibDirectory (Join-Path -Path $PSScriptRoot -ChildPath $MyInvocation.MyCommand.Name) -ForceReload;
|
||||
19
lib/core/tools/New-StringTree.psm1
Normal file
19
lib/core/tools/New-StringTree.psm1
Normal 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;
|
||||
}
|
||||
3
lib/core/tools/Test-Numeric.psm1
Normal file
3
lib/core/tools/Test-Numeric.psm1
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
function Test-Numeric ($number) {
|
||||
return $number -Match "^[\d\.]+$";
|
||||
}
|
||||
Loading…
Reference in a new issue