Spizzi.Profile.psm1
# Get and dot source all helper functions (private) Split-Path -Path $PSCommandPath | Join-Path -ChildPath 'Helpers' | Get-ChildItem -Include '*.ps1' -Exclude '*.Tests.*' -Recurse | ForEach-Object { . $_.FullName } # Get and dot source all external functions (public) Split-Path -Path $PSCommandPath | Join-Path -ChildPath 'Functions' | Get-ChildItem -Include '*.ps1' -Exclude '*.Tests.*' -Recurse | ForEach-Object { . $_.FullName } # Restore the original prompt when remove the module $PromptBackup = Get-Content -Path Function:Prompt -ErrorAction SilentlyContinue $MyInvocation.MyCommand.ScriptBlock.Module.OnRemove = { Set-Content Function:Prompt -Value $PromptBackup } |