Skip to content

Instantly share code, notes, and snippets.

@ryancbutler
Created September 12, 2017 03:22
Show Gist options
  • Save ryancbutler/debd54d3de900f7dc7972b143cbb58a0 to your computer and use it in GitHub Desktop.
Save ryancbutler/debd54d3de900f7dc7972b143cbb58a0 to your computer and use it in GitHub Desktop.
$Public = @( Get-ChildItem -Path $PSScriptRoot\Public\*.ps1 -ErrorAction SilentlyContinue )
$Private = @( Get-ChildItem -Path $PSScriptRoot\Private\*.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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment