r/PowerShell • u/Lord_Saren • May 04 '21
Question Powershell - Super slow Startup - Not Modules
So I have looked around and tried various fixes and nothing seems to work.
So I am using the default powershell and new Windows Terminal, I have originally installed the new powershell 7 but removed it.
I also had OhmyPosh as a module but wiped all modules and command history file. It still takes a good minute for powershell to show me a prompt. Using both Windows Terminal and Powershell itself. ISE does the same.
I am on windows 10 20h2 and I believe fully up to date. Any recommendation on how to fix this issue?
2
Upvotes
2
u/BetrayedMilk May 04 '21
Don’t suppose you’ve got stuff in your $profile?
2
u/jrdnr_ May 04 '21
Double check where $profile links to I expect it to be something like
"...\Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1" or "Microsoft.PowerShellISE_profile.ps1". However there is a "\Documents\WindowsPowershell\profile.ps1" file as well. So if your just checking $profile you may be missing a bunch of stuff in your prfile.ps1 file. Check all three files and let us know.
I know you said "Not Modules" but since you didn't expand on that it would be woth checking your local module path "\Documents\windowspowershell\Modules" and "C:\Program Files\WindowsPowerShell\Modules" to see what is there.
2
u/branhama May 05 '21
To list out the profiles PowerShell can load use the following command:
You could also try to force a no profile load with:
If those options to not seem to help perhaps it is not a profile issue at all. I believe I saw something about using PSReadLine. Check this and be sure you just don't have a ton of logs.
HERE
Past this try this optimizer script that recompiles some files which did seem to improve my performance a bit. HERE
1
u/user01401 May 04 '21
Why did you delete PS7? It's definitely a lot faster