Powershell: Slow startup when loading one-line profile on a SSD

Created on 13 Jul 2017  路  5Comments  路  Source: PowerShell/PowerShell

Powershell takes a lot of time to launch, even on my computer with an SSD disk.
It says "Loading personal and system profiles took 1031ms."
My only profile option is set at $PROFILE.AllUsersAllHosts, with a single line to disable deafening beep.
Set-PSReadlineOption -BellStyle None.
Even with the profile file deleted, powershell still takes quite a lot of time to launch, but less than with the profile.
It used to take ~600ms to launch, but it jumped to ~1s after KB4025342 .

Environment data

PS C:\Users\phg> $PSVersionTable

Name                           Value
----                           -----
PSVersion                      5.1.15063.483
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.15063.483
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1

Issue-Question Resolution-Answered

Most helpful comment

You might also try powershell -noprofile for Windows PowerShell to eliminate any profile as a factor

All 5 comments

Can you try PSCore6? Our target is ~250ms cold startup time (excluding user profiles). I'm using build 16225 of Win10 and it took 600ms for Windows PowerShell 5.1 to startup.

@SteveL-MSFT with powershell 6 it starts up way faster than the current 5.1.15063.483 version, but it does not show message with startup time.

@pedrogarcia the startup time output only happens for Windows PowerShell currently. You can time it yourself by doing this from Windows PowerShell:

measure-command { & 'C:\Program Files\PowerShell\6.0.0-beta.3\powershell.exe' -c 1+1 }

You might also try powershell -noprofile for Windows PowerShell to eliminate any profile as a factor

This issue has been marked as answered and has not had any activity for 1 day. It has been closed for housekeeping purposes.

Was this page helpful?
0 / 5 - 0 ratings