-
Notifications
You must be signed in to change notification settings - Fork 293
Description
I'm not sure where this belongs or if it even belongs in this repo but... Most of us probably have pretty complex profile scripts. My PSReadline custom configuration alone is over 200 lines. So I've taken to moving those "module-specific" configurations out into a separate file that sits by my profile.ps1 file. It is called "PSReadline_config.ps1" - I've seen this approach with Bash (.bash_aliases). I was thinking something like <ModuleOrDescription>_config.ps1. Then in your profile script you just dot source it in like so:
. $PSScriptRoot\PSReadline_config.ps1This has made it easier for me to share my PSReadline config with others.
BTW there is probably some best practices around "which" profile scripts to use. I'm old school and use the current user all hosts script and for PSReadline I check against the host name. I should probably use the console's profile Microsoft.PowerShell_profile.ps and ditch the if ($host.Name -eq 'ConsoleHost') check.