PowerShell / PowerShell/PowerShell
pwsh.exe -NoProfile takes minutes to load after .NET update
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- C#
- Sterne
- 55.5k
- Forks
- 8.5k
- Ø Merge
- 1 T. 2 Std.
- Gemergte PRs (30 T.)
- 88
Beschreibung
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
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Reproduzieren Sie die Verlangsamung mit pwsh.exe -NoProfile und Measure-Command { Get-Date } in der gemeldeten PowerShell 7.4.2-Windows-Umgebung und vergleichen Sie anschließend den Start mit und ohne Profile. Prüfen Sie die Symptome und das zugehörige Issue #21546; als erledigt gilt die Aufgabe, wenn Start und grundlegende Befehle wieder eine akzeptable Leistung erreichen und die Regression durch einen geeigneten Test oder eine Diagnose abgedeckt ist.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- powershell
- Bereich
- cli, performance
- Issue-Typ
- Bug
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Muss geklärt werden
- Anfängerfreundlichkeit
- 30/100