PowerShell / PowerShell/PowerShell
pwsh.exe -NoProfile takes minutes to load after .NET update
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 55.5k
- Forks
- 8.5k
- Avg merge
- 1d 2h
- Merged PRs (30d)
- 88
Description
Prerequisites
- Write a descriptive title.
- Make sure you are able to repro it on the latest released version
- Search the existing issues.
- Refer to the FAQ.
- Refer to Differences between Windows PowerShell 5.1 and PowerShell.
Steps to reproduce
I installed these updates yesterday:
Since then, PowerShell 7.4.2 takes about three minutes to load, even when I use pwsh.exe -NoProfile. Since there's no difference in behavior with or without loading the profile, here's an example when I do load with a profile so you can see the load time.
PowerShell 7.4.2
Loading personal and system profiles took 180574ms.
Even after loading, everything is glacially slow. For example:
PS C:\Users\Chad> Measure-Command { Get-Date }
Days : 0
Hours : 0
Minutes : 0
Seconds : 10
Milliseconds : 11
Ticks : 100117544
TotalDays : 0.000115876787037037
TotalHours : 0.00278104288888889
TotalMinutes : 0.166862573333333
TotalSeconds : 10.0117544
TotalMilliseconds : 10011.7544
Things I've tried:
pwsh.exe -NoProfilepwsh.exe -NoProfile -NonInteractivePOWERSHELL_TELEMETRY_OPTOUT = 1andPOWERSHELL_UPDATECHECK = Off- Verified that
Controlled Folder Accessis set toNot configured(Issue https://github.com/PowerShell/PowerShell/issues/21546 has similar symptoms) - Reinstalled
7.4.2
Expected behavior
Acceptable performance
Actual behavior
As described above
Error details
No response
Environment data
Name Value
---- -----
PSVersion 7.4.2
PSEdition Core
GitCommitId 7.4.2
OS Microsoft Windows 10.0.22631
Platform Win32NT
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
Visuals
No response
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the slowdown with pwsh.exe -NoProfile and Measure-Command { Get-Date } on the reported PowerShell 7.4.2 Windows environment, then compare startup with and without profiles. Review the symptoms and related issue #21546; done means startup and basic commands return to acceptable performance and the regression is covered by an appropriate test or diagnosis.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- powershell
- Domain
- cli, performance
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100