Skip to content

Instantly share code, notes, and snippets.

@stephent23
Created July 11, 2016 19:36
Show Gist options
  • Save stephent23/be554ab53e8a214c0b68bb5cdb34c2a0 to your computer and use it in GitHub Desktop.
Save stephent23/be554ab53e8a214c0b68bb5cdb34c2a0 to your computer and use it in GitHub Desktop.
An example of a PowerShell Module file that loads all of the scripts / functions into memory
## Name of module
#
# Internal
#
[Array]$Internal = 'NameOfScript',
'NameOfScript '
if ($Internal.Count -ge 1) {
$Internal | ForEach-Object {
. "$psscriptroot\functions-internal\$_.ps1"
}
}
#
# Public
#
[Array]$Public = 'NameOfScript',
'NameOfScript'
if ($Public.Count -ge 1) {
$Public | ForEach-Object {
. "$psscriptroot\functions\$_.ps1"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment