-
Notifications
You must be signed in to change notification settings - Fork 27
Expand file tree
/
Copy pathAnyBox.psm1
More file actions
executable file
·27 lines (23 loc) · 822 Bytes
/
AnyBox.psm1
File metadata and controls
executable file
·27 lines (23 loc) · 822 Bytes
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
[string]$ModuleRoot = $PSScriptRoot
if (-not $ModuleRoot)
{
$ModuleRoot = Split-Path $MyInvocation.MyCommand.Path -Parent
}
#Get public and private function definition files.
$Public = @( Get-ChildItem -Path "$ModuleRoot\Public\*.ps1" -ErrorAction SilentlyContinue )
$Private = @( Get-ChildItem -Path "$ModuleRoot\Private\*.ps1" -ErrorAction SilentlyContinue )
$Types = @( Get-ChildItem -Path "$ModuleRoot\Types\*.ps1" -ErrorAction SilentlyContinue )
#Dot source the files
foreach ($import in @($Public + $Private + $Types))
{
try
{
Write-Verbose -Message "Importing $($import.fullname)"
. $import.fullname
}
catch
{
Write-Error -Message "Failed to import $($import.fullname): $_"
}
}
Export-ModuleMember -Function ($Public | Select-Object -ExpandProperty BaseName)