r/PowerShell • u/nyxvren • 25d ago
Question How do you keep a PowerShell 7 profile useful without slowing down startup?
I’m setting up a PowerShell 7 environment on Windows and using Windows Terminal, Oh My Posh, and PSFzf.
I want a useful prompt and better command history, but I don’t want every new terminal tab to load a long list of modules.
The basic setup I’m considering looks like this:
oh-my-posh init pwsh | Invoke-Expression
Import-Module PSFzf
Would you put both directly in $PROFILE, or keep the profile minimal and load some tools only when needed?
Have you noticed a meaningful difference in startup time? I’d be interested in seeing how you organize your profiles in practice.
4
u/purplemonkeymad 25d ago
Personally I dropped everything expect configuration variables from my profile (eg psreadline settings, default parameter values.) For nice to have features I just make sure stuff is in a module so that it auto-loads on first use. I skip stuff like oh-my-posh to prevent startup slowness.
I also work on many machines so it also stops me getting used to custom settings.
2
u/BlackV 25d ago
Pretty much I have as little as I can in there
simple write host that says
function to open my psreadline history (could make it a module, but its more effort than reward
customised prompt
default parameter valuefor format cmdlets
2
u/[deleted] 24d ago
[removed] — view removed comment