forked from Stephanevg/PSHTML
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPSHtml.psm1
37 lines (31 loc) · 1.1 KB
/
PSHtml.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
35
36
37
<#
.SYNOPSIS
PowerShell Module file for PSHTML
.DESCRIPTION
This PowerShell module file will load all the functions present under Private and Public folder.
.LINK
https://github.com/Stephanevg/PSHTML
#>
# Retrieve parent folder
$ScriptPath = Split-Path -Path $MyInvocation.MyCommand.Path
write-verbose -Message "Loading Private Functions"
$PrivateFunctions = Get-ChildItem -Path "$ScriptPath\Functions\Private" -Filter *.ps1 | Select-Object -ExpandProperty FullName
foreach ($Private in $PrivateFunctions){
write-verbose -Message "importing function $($function)"
try{
. $Private
}catch{
write-warning -Message $_
}
}
write-verbose -Message "Loading Private Functions"
$PublicFunctions = Get-ChildItem -Path "$ScriptPath\Functions\public" -Filter *.ps1 | Select-Object -ExpandProperty FullName
foreach ($public in $PublicFunctions){
write-verbose "importing function $($function)"
try{
. $public
}catch{
write-warning -Message $_
}
}
New-Alias -Name Include -Value 'Get-HTMLTemplate' -Description "Include parts of PSHTML documents using Templates"