-
-
Save bielawb/6c6632ec95d6f6779f8fdf21b465f298 to your computer and use it in GitHub Desktop.
Two options for script-per-function module design
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Works fine in "normal" environment, can become slow when network is more complex...: | |
foreach ($file in Get-ChildItem $PSScriptRoot\*.ps1) { | |
. $file.FullName | |
} | |
# Should be fast everywhere, but it's bit more complex... | |
foreach ($file in Get-ChildItem $PSScriptRoot\*.ps1) { | |
. ( | |
[scriptblock]::Create( | |
[io.file]::ReadAllText($file) | |
) | |
) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment