Created
May 24, 2022 17:40
-
-
Save sassdawe/19eec12c32c267d541fb040534cab0bf to your computer and use it in GitHub Desktop.
Turn a monolit PowerShell module into multiple files for easier editing
This file contains hidden or 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
$module = "module name" | |
$folder = "destination folder" | |
(((Get-Module $module).ExportedFunctions).Values.GetEnumerator()) | Foreach-Object { | |
"function $($_.Name) { `n $($_.definition)`n}" > "$folder\function-$($_.name).ps1" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment