-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathPSNow.psm1
27 lines (22 loc) · 1.06 KB
/
PSNow.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
$BHPathDivider = [System.IO.Path]::DirectorySeparatorChar
if (-not (Get-Module -Name 'Plaster' -ListAvailable)) {
Write-Output "`nPlaster is not yet installed...installing Plaster now..."
Install-Module -Name 'Plaster' -Scope 'CurrentUser' -Repository PSGALLERY -Force
}
if (-not (Test-Path -path .gitignore)){
New-Item -ItemType File -Name ".gitignore"
Add-Content -Path $($PSScriptRoot + $BHPathDivider + ".gitignore") -Value ".vscode/"
Add-Content -Path $($PSScriptRoot + $BHPathDivider + ".gitignore") -Value ".github/"
}
$Public = @( Get-ChildItem -Path $($PSScriptRoot + $BHPathDivider + "Public" + $BHPathDivider + "*.ps1") -ErrorAction SilentlyContinue )
$Private = @( Get-ChildItem -Path $($PSScriptRoot + $BHPathDivider + "Private" + $BHPathDivider + "*.ps1") -ErrorAction SilentlyContinue )
#Dot source the files
Foreach ($import in @($Public + $Private)) {
Try {
. $import.fullname
}
Catch {
Write-Error -Message "Failed to import function $($import.fullname): $_"
}
}
Export-ModuleMember -Function $Public.Basename