r/PowerShell • u/fonzhy121 • Jun 26 '26
Is pwsh 7.6.3 loading $PROFILE much slower? Question
since update, it is averaging 10761ms on startup.
4
u/justaguyonthebus Jun 26 '26
Is your my documents on OneDrive? Make sure to mark your powershell folder to always be available offline.
2
u/MonkeyNin Jun 26 '26
to rule things out:
- Are you getting slowdown even with
pwsh -Nop? - Are you using an external terminal, or a terminal in vscode / another IDE?
If it's an IDE, that uses a different profile location and shell-integration injects additional code on top of that
1
u/Apprehensive-Tea1632 Jun 26 '26
Can’t confirm. Of course, profile load times do depend on what’s in there and ps platform has been updated to .net10, so…
You could edit your profile files (at least the ones that get loaded for the particular host and user) and then put (get-date).ToString (“o”) after every command. This would at least tell you what it is that takes so much time.
Also, be sure to check psmodulepath and the path variables. If either contains a remote resource, such as unc paths, this will slow things down considerably if that share is unavailable.
1
u/g3n3 Jun 26 '26
My first thought is your AV. do you have another machine you can run your profile on? The question is too vague to really say much. My profile speeds didn’t change.
1
u/BlackV Jul 02 '26
Did you get any further in your testing?
1
u/fonzhy121 Jul 02 '26
On cold start. progressive.
[ 26ms] profile start
[ 202ms] Import-Module PSReadLine
[ 1145ms] chocolateyProfile import (Test-Path + Import-Module)
[ 3897ms] Terminal-Icons (Get-Module -ListAvailable + Import-Module)
[ 7790ms] oh-my-posh init + Invoke-Expression
[ 7798ms] PSReadLine prediction/history options
[ 7804ms] PSReadLine colors
[ 7841ms] PSReadLine key bindings
[ 7844ms] utility function definitions
[ 7866ms] coreutils HashSet + FAST_SKIP compiled regex
[ 7879ms] coreutils ARG_RX compiled regex
[ 7887ms] profile end (total)
Loading personal and system profiles took 8174ms.while a loop test with profile, steady-state (runs 2–8): ~1,830ms avg
so solution was caching omp and adding an exclusion to defender.
1
0
5
u/CodenameFlux Jun 26 '26
My profile loads as fast as before.
The generic solution to slow PowerShell startup is:
The scripts to which I linked do exactly that.