-
Notifications
You must be signed in to change notification settings - Fork 0
/
SE.IntroModule.psm1
32 lines (22 loc) · 970 Bytes
/
SE.IntroModule.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
$ModName = 'SE.IntroModule'
Get-Module $ModName | Remove-Module -Force
Write-Host "`n`n$ModName module import starting`n" -ForegroundColor Cyan
#
# Import main functions
#
$Public = @(Get-ChildItem (Join-Path $PSScriptRoot 'Public') -Filter *.ps1)
$Private = @(Get-ChildItem (Join-Path $PSScriptRoot 'Private') -Filter *.ps1 -ErrorAction SilentlyContinue)
foreach ($F in ($Private+$Public) ) {
Write-Host ("Importing $($F.Name)... ") -NoNewline
try {
. ($F.FullName)
Write-Host ' OK ' -ForegroundColor Green
} catch {
Write-Host 'FAILED' -ForegroundColor Red
}
}
Export-ModuleMember -Function $Public.BaseName
Write-Host "Exported $($Public.Count) member(s)"
Export-ModuleMember -Alias *
Write-Host "`nType 'Get-Command -Module $ModName' for list of commands, 'Get-Help <CommandName>' for help, or"
Write-Host "'Get-Command -Module $ModName | Get-Help | Select Name, Synopsis' for explanation on all commands`n"