-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathPSSVG.psm1
26 lines (23 loc) · 889 Bytes
/
PSSVG.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
foreach ($file in Get-ChildItem -Filter *-*.ps1 -Path $PSScriptRoot) {
if ($file.Name -like '*-*.ps1' -and $file.Name -notlike '.*.ps1') {
. $file.FullName
}
}
$svgCommandsPath = Join-Path $PSScriptRoot Commands
foreach ($file in Get-ChildItem -Filter *.ps1 -Path $svgCommandsPath -Recurse) {
if ($file.Name -match '^SVG\.' -and $file.Name -notmatch '\.ps1{0,1}\.ps1$') {
. $file.FullName
$functionName = $file.Name -replace '\.ps1$'
$aliasName = $functionName -replace '^SVG\.'
if ($aliasName -eq 'svg') {
Set-Alias "=<svg>" "$functionName"
Set-Alias "svg" "$functionName"
} else {
Set-Alias "=<svg.$aliasName>" "$functionName"
}
}
elseif ($file.Name -like '*-*.ps1') {
. $file.FullName
}
}
Export-ModuleMember -Alias * -Function *