-
-
Notifications
You must be signed in to change notification settings - Fork 5
/
AdminToolkit.psm1
36 lines (31 loc) · 1.14 KB
/
AdminToolkit.psm1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/usr/bin/env pwsh
#Dot source all functions in all ps1 files located in the module folder
$PublicFunctionsFiles = [System.IO.Path]::Combine($PSScriptRoot,"Functions","Public","*.ps1")
Get-ChildItem -Path $PublicFunctionsFiles -Exclude *.tests.ps1, *profile.ps1 |
ForEach-Object {
try {
. $_.FullName
} catch {
# Write-Warning "$($_.Exception.Message)"
}
}
#This allows the Private functions to access the private ones, but the private ones are note exported in .psd1 file
$PrivateFunctionsFiles = [System.IO.Path]::Combine($PSScriptRoot,"Functions","Private","*.ps1")
Get-ChildItem -Path $PrivateFunctionsFiles -Exclude *.tests.ps1, *profile.ps1 |
ForEach-Object {
try {
. $_.FullName
} catch {
# Write-Warning "$($_.Exception.Message)"
}
}
#Dor source all argument completer files for module
$ArgCompleterFunctionsFiles = [System.IO.Path]::Combine($PSScriptRoot,"Functions","ArgCompleter","*.ps1")
Get-ChildItem -Path $ArgCompleterFunctionsFiles -Exclude *.tests.ps1, *profile.ps1 |
ForEach-Object {
try {
. $_.FullName
} catch {
# Write-Warning "$($_.Exception.Message)"
}
}