Powershell slow starting on Windows 10





.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ height:90px;width:728px;box-sizing:border-box;
}







8















I have problem with slow starting of powershell prompt on Windows 10 ( Version 1703 - Creators Update ).



My hw specs ( quite fast machine ): Intel i5-7440HQ (Quad Core) / 32GB DDR4 RAM / 512 Samsung SSD hard drive.



I tried to bypass profile and execution policy but it does not change anything:




powershell -noprofile -ExecutionPolicy Bypass ( Measure-Command { powershell "Write-Host 1" } ).TotalSeconds



6,228067




My friends same laptop with Windows 10 without Creators Update runs powershell in less than 0,5 sec.



Also tried do some compilation with ngen.exe but it didn't help:



$env:path = [Runtime.InteropServices.RuntimeEnvironment]::GetRuntimeDirectory()
[AppDomain]::CurrentDomain.GetAssemblies() | % {
if (! $_.location) {continue}
$Name = Split-Path $_.location -leaf
Write-Host -ForegroundColor Yellow "NGENing : $Name"
ngen install $_.location | % {"`t$_"}
}


Any idea how may I investigate this issue?



Greetings










share|improve this question

























  • You should start by checking your profile script to see if anything is running in there that is delaying startup. My output is 1.2774795 seconds. Also, what machine, processor, memory, other things running?

    – Julian Knight
    May 24 '17 at 14:33








  • 6





    powershell is always slow to start. But Ms ignores those complains and only response "powershell is fast"

    – magicandre1981
    May 24 '17 at 14:36











  • As You see -noprofile option is set. No difference.

    – mike
    May 24 '17 at 17:21











  • I see it. send this to MS, but they ignore any reports that powershell is slow

    – magicandre1981
    May 25 '17 at 18:27






  • 1





    again, for me powershell is also always slow. ask this Microsoft.

    – magicandre1981
    May 26 '17 at 15:41


















8















I have problem with slow starting of powershell prompt on Windows 10 ( Version 1703 - Creators Update ).



My hw specs ( quite fast machine ): Intel i5-7440HQ (Quad Core) / 32GB DDR4 RAM / 512 Samsung SSD hard drive.



I tried to bypass profile and execution policy but it does not change anything:




powershell -noprofile -ExecutionPolicy Bypass ( Measure-Command { powershell "Write-Host 1" } ).TotalSeconds



6,228067




My friends same laptop with Windows 10 without Creators Update runs powershell in less than 0,5 sec.



Also tried do some compilation with ngen.exe but it didn't help:



$env:path = [Runtime.InteropServices.RuntimeEnvironment]::GetRuntimeDirectory()
[AppDomain]::CurrentDomain.GetAssemblies() | % {
if (! $_.location) {continue}
$Name = Split-Path $_.location -leaf
Write-Host -ForegroundColor Yellow "NGENing : $Name"
ngen install $_.location | % {"`t$_"}
}


Any idea how may I investigate this issue?



Greetings










share|improve this question

























  • You should start by checking your profile script to see if anything is running in there that is delaying startup. My output is 1.2774795 seconds. Also, what machine, processor, memory, other things running?

    – Julian Knight
    May 24 '17 at 14:33








  • 6





    powershell is always slow to start. But Ms ignores those complains and only response "powershell is fast"

    – magicandre1981
    May 24 '17 at 14:36











  • As You see -noprofile option is set. No difference.

    – mike
    May 24 '17 at 17:21











  • I see it. send this to MS, but they ignore any reports that powershell is slow

    – magicandre1981
    May 25 '17 at 18:27






  • 1





    again, for me powershell is also always slow. ask this Microsoft.

    – magicandre1981
    May 26 '17 at 15:41














8












8








8


2






I have problem with slow starting of powershell prompt on Windows 10 ( Version 1703 - Creators Update ).



My hw specs ( quite fast machine ): Intel i5-7440HQ (Quad Core) / 32GB DDR4 RAM / 512 Samsung SSD hard drive.



I tried to bypass profile and execution policy but it does not change anything:




powershell -noprofile -ExecutionPolicy Bypass ( Measure-Command { powershell "Write-Host 1" } ).TotalSeconds



6,228067




My friends same laptop with Windows 10 without Creators Update runs powershell in less than 0,5 sec.



Also tried do some compilation with ngen.exe but it didn't help:



$env:path = [Runtime.InteropServices.RuntimeEnvironment]::GetRuntimeDirectory()
[AppDomain]::CurrentDomain.GetAssemblies() | % {
if (! $_.location) {continue}
$Name = Split-Path $_.location -leaf
Write-Host -ForegroundColor Yellow "NGENing : $Name"
ngen install $_.location | % {"`t$_"}
}


Any idea how may I investigate this issue?



Greetings










share|improve this question
















I have problem with slow starting of powershell prompt on Windows 10 ( Version 1703 - Creators Update ).



My hw specs ( quite fast machine ): Intel i5-7440HQ (Quad Core) / 32GB DDR4 RAM / 512 Samsung SSD hard drive.



I tried to bypass profile and execution policy but it does not change anything:




powershell -noprofile -ExecutionPolicy Bypass ( Measure-Command { powershell "Write-Host 1" } ).TotalSeconds



6,228067




My friends same laptop with Windows 10 without Creators Update runs powershell in less than 0,5 sec.



Also tried do some compilation with ngen.exe but it didn't help:



$env:path = [Runtime.InteropServices.RuntimeEnvironment]::GetRuntimeDirectory()
[AppDomain]::CurrentDomain.GetAssemblies() | % {
if (! $_.location) {continue}
$Name = Split-Path $_.location -leaf
Write-Host -ForegroundColor Yellow "NGENing : $Name"
ngen install $_.location | % {"`t$_"}
}


Any idea how may I investigate this issue?



Greetings







windows-10 performance powershell






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited May 24 '17 at 19:36







mike

















asked May 24 '17 at 14:31









mikemike

6626




6626













  • You should start by checking your profile script to see if anything is running in there that is delaying startup. My output is 1.2774795 seconds. Also, what machine, processor, memory, other things running?

    – Julian Knight
    May 24 '17 at 14:33








  • 6





    powershell is always slow to start. But Ms ignores those complains and only response "powershell is fast"

    – magicandre1981
    May 24 '17 at 14:36











  • As You see -noprofile option is set. No difference.

    – mike
    May 24 '17 at 17:21











  • I see it. send this to MS, but they ignore any reports that powershell is slow

    – magicandre1981
    May 25 '17 at 18:27






  • 1





    again, for me powershell is also always slow. ask this Microsoft.

    – magicandre1981
    May 26 '17 at 15:41



















  • You should start by checking your profile script to see if anything is running in there that is delaying startup. My output is 1.2774795 seconds. Also, what machine, processor, memory, other things running?

    – Julian Knight
    May 24 '17 at 14:33








  • 6





    powershell is always slow to start. But Ms ignores those complains and only response "powershell is fast"

    – magicandre1981
    May 24 '17 at 14:36











  • As You see -noprofile option is set. No difference.

    – mike
    May 24 '17 at 17:21











  • I see it. send this to MS, but they ignore any reports that powershell is slow

    – magicandre1981
    May 25 '17 at 18:27






  • 1





    again, for me powershell is also always slow. ask this Microsoft.

    – magicandre1981
    May 26 '17 at 15:41

















You should start by checking your profile script to see if anything is running in there that is delaying startup. My output is 1.2774795 seconds. Also, what machine, processor, memory, other things running?

– Julian Knight
May 24 '17 at 14:33







You should start by checking your profile script to see if anything is running in there that is delaying startup. My output is 1.2774795 seconds. Also, what machine, processor, memory, other things running?

– Julian Knight
May 24 '17 at 14:33






6




6





powershell is always slow to start. But Ms ignores those complains and only response "powershell is fast"

– magicandre1981
May 24 '17 at 14:36





powershell is always slow to start. But Ms ignores those complains and only response "powershell is fast"

– magicandre1981
May 24 '17 at 14:36













As You see -noprofile option is set. No difference.

– mike
May 24 '17 at 17:21





As You see -noprofile option is set. No difference.

– mike
May 24 '17 at 17:21













I see it. send this to MS, but they ignore any reports that powershell is slow

– magicandre1981
May 25 '17 at 18:27





I see it. send this to MS, but they ignore any reports that powershell is slow

– magicandre1981
May 25 '17 at 18:27




1




1





again, for me powershell is also always slow. ask this Microsoft.

– magicandre1981
May 26 '17 at 15:41





again, for me powershell is also always slow. ask this Microsoft.

– magicandre1981
May 26 '17 at 15:41










3 Answers
3






active

oldest

votes


















2














What you could try is create a shortcut to powershell.exe , right-click on it > properties, go to tab options, click on "use legacy console". My screenreader (magic and zoomtext) couldn't stand the 'new' çonsole which came with the fall update (Powershell was veeeerrrrry slow) With legacy on everything works fine again.






share|improve this answer































    1














    This was happening to me also - though maybe not the best route, adding powershell.exe to the list of Windows Defender exclusions sped it up from 20 seconds to < 1 second.



    Using legacy console, purging PSReadLine, and running ngen did not seem to help at all.






    share|improve this answer



















    • 1





      Perfect! This did the trick. I had an issue similar to yours where the window would open up but the path wouldn't load for more than 30 seconds. As soon as I excluded it from Defender, it loaded in a snap. Thanks a lot!

      – Paras Shah
      Apr 1 at 2:22



















    -1














    I had been experiencing the same issue for quite some time until PowerShell started failing on startup with the following error:



    Exception:
    System.OutOfMemoryException: Array dimensions exceeded supported range.
    at System.Collections.Generic.List`1.set_Capacity(Int32 value)
    at System.Collections.Generic.List`1.EnsureCapacity(Int32 min)
    at System.Collections.Generic.List`1.Add(T item)
    at System.IO.File.InternalReadAllLines(String path, Encoding encoding)
    at Microsoft.PowerShell.PSConsoleReadLine.<ReadHistoryFile>b__67_0()
    at Microsoft.PowerShell.PSConsoleReadLine.WithHistoryFileMutexDo(Int32 timeout, Action action)
    at Microsoft.PowerShell.PSConsoleReadLine.DelayedOneTimeInitialize()
    at Microsoft.PowerShell.PSConsoleReadLine.Initialize(Runspace runspace, EngineIntrinsics engineIntrinsics)
    at Microsoft.PowerShell.PSConsoleReadLine.ReadLine(Runspace runspace, EngineIntrinsics engineIntrinsics)
    -----------------------------------------------------------------------


    This led me to the existing Github issue: https://github.com/lzybkr/PSReadLine/issues/673



    I tried deleting history file in ~AppDataRoamingMicrosoftWindowsPowerShellPSReadline which was over 6 GB by then and after that PowerShell console started opening pretty quickly.



    Maybe the slowness you experience is the PowerShell trying to read a big history file (which is not yet big enough to cause OutOfMemory).






    share|improve this answer
























      Your Answer








      StackExchange.ready(function() {
      var channelOptions = {
      tags: "".split(" "),
      id: "3"
      };
      initTagRenderer("".split(" "), "".split(" "), channelOptions);

      StackExchange.using("externalEditor", function() {
      // Have to fire editor after snippets, if snippets enabled
      if (StackExchange.settings.snippets.snippetsEnabled) {
      StackExchange.using("snippets", function() {
      createEditor();
      });
      }
      else {
      createEditor();
      }
      });

      function createEditor() {
      StackExchange.prepareEditor({
      heartbeatType: 'answer',
      autoActivateHeartbeat: false,
      convertImagesToLinks: true,
      noModals: true,
      showLowRepImageUploadWarning: true,
      reputationToPostImages: 10,
      bindNavPrevention: true,
      postfix: "",
      imageUploader: {
      brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
      contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
      allowUrls: true
      },
      onDemand: true,
      discardSelector: ".discard-answer"
      ,immediatelyShowMarkdownHelp:true
      });


      }
      });














      draft saved

      draft discarded


















      StackExchange.ready(
      function () {
      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1212442%2fpowershell-slow-starting-on-windows-10%23new-answer', 'question_page');
      }
      );

      Post as a guest















      Required, but never shown

























      3 Answers
      3






      active

      oldest

      votes








      3 Answers
      3






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes









      2














      What you could try is create a shortcut to powershell.exe , right-click on it > properties, go to tab options, click on "use legacy console". My screenreader (magic and zoomtext) couldn't stand the 'new' çonsole which came with the fall update (Powershell was veeeerrrrry slow) With legacy on everything works fine again.






      share|improve this answer




























        2














        What you could try is create a shortcut to powershell.exe , right-click on it > properties, go to tab options, click on "use legacy console". My screenreader (magic and zoomtext) couldn't stand the 'new' çonsole which came with the fall update (Powershell was veeeerrrrry slow) With legacy on everything works fine again.






        share|improve this answer


























          2












          2








          2







          What you could try is create a shortcut to powershell.exe , right-click on it > properties, go to tab options, click on "use legacy console". My screenreader (magic and zoomtext) couldn't stand the 'new' çonsole which came with the fall update (Powershell was veeeerrrrry slow) With legacy on everything works fine again.






          share|improve this answer













          What you could try is create a shortcut to powershell.exe , right-click on it > properties, go to tab options, click on "use legacy console". My screenreader (magic and zoomtext) couldn't stand the 'new' çonsole which came with the fall update (Powershell was veeeerrrrry slow) With legacy on everything works fine again.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Jan 15 '18 at 10:36









          Peter BakkerPeter Bakker

          212




          212

























              1














              This was happening to me also - though maybe not the best route, adding powershell.exe to the list of Windows Defender exclusions sped it up from 20 seconds to < 1 second.



              Using legacy console, purging PSReadLine, and running ngen did not seem to help at all.






              share|improve this answer



















              • 1





                Perfect! This did the trick. I had an issue similar to yours where the window would open up but the path wouldn't load for more than 30 seconds. As soon as I excluded it from Defender, it loaded in a snap. Thanks a lot!

                – Paras Shah
                Apr 1 at 2:22
















              1














              This was happening to me also - though maybe not the best route, adding powershell.exe to the list of Windows Defender exclusions sped it up from 20 seconds to < 1 second.



              Using legacy console, purging PSReadLine, and running ngen did not seem to help at all.






              share|improve this answer



















              • 1





                Perfect! This did the trick. I had an issue similar to yours where the window would open up but the path wouldn't load for more than 30 seconds. As soon as I excluded it from Defender, it loaded in a snap. Thanks a lot!

                – Paras Shah
                Apr 1 at 2:22














              1












              1








              1







              This was happening to me also - though maybe not the best route, adding powershell.exe to the list of Windows Defender exclusions sped it up from 20 seconds to < 1 second.



              Using legacy console, purging PSReadLine, and running ngen did not seem to help at all.






              share|improve this answer













              This was happening to me also - though maybe not the best route, adding powershell.exe to the list of Windows Defender exclusions sped it up from 20 seconds to < 1 second.



              Using legacy console, purging PSReadLine, and running ngen did not seem to help at all.







              share|improve this answer












              share|improve this answer



              share|improve this answer










              answered Mar 5 at 20:12









              SliverNinja - MSFTSliverNinja - MSFT

              1688




              1688








              • 1





                Perfect! This did the trick. I had an issue similar to yours where the window would open up but the path wouldn't load for more than 30 seconds. As soon as I excluded it from Defender, it loaded in a snap. Thanks a lot!

                – Paras Shah
                Apr 1 at 2:22














              • 1





                Perfect! This did the trick. I had an issue similar to yours where the window would open up but the path wouldn't load for more than 30 seconds. As soon as I excluded it from Defender, it loaded in a snap. Thanks a lot!

                – Paras Shah
                Apr 1 at 2:22








              1




              1





              Perfect! This did the trick. I had an issue similar to yours where the window would open up but the path wouldn't load for more than 30 seconds. As soon as I excluded it from Defender, it loaded in a snap. Thanks a lot!

              – Paras Shah
              Apr 1 at 2:22





              Perfect! This did the trick. I had an issue similar to yours where the window would open up but the path wouldn't load for more than 30 seconds. As soon as I excluded it from Defender, it loaded in a snap. Thanks a lot!

              – Paras Shah
              Apr 1 at 2:22











              -1














              I had been experiencing the same issue for quite some time until PowerShell started failing on startup with the following error:



              Exception:
              System.OutOfMemoryException: Array dimensions exceeded supported range.
              at System.Collections.Generic.List`1.set_Capacity(Int32 value)
              at System.Collections.Generic.List`1.EnsureCapacity(Int32 min)
              at System.Collections.Generic.List`1.Add(T item)
              at System.IO.File.InternalReadAllLines(String path, Encoding encoding)
              at Microsoft.PowerShell.PSConsoleReadLine.<ReadHistoryFile>b__67_0()
              at Microsoft.PowerShell.PSConsoleReadLine.WithHistoryFileMutexDo(Int32 timeout, Action action)
              at Microsoft.PowerShell.PSConsoleReadLine.DelayedOneTimeInitialize()
              at Microsoft.PowerShell.PSConsoleReadLine.Initialize(Runspace runspace, EngineIntrinsics engineIntrinsics)
              at Microsoft.PowerShell.PSConsoleReadLine.ReadLine(Runspace runspace, EngineIntrinsics engineIntrinsics)
              -----------------------------------------------------------------------


              This led me to the existing Github issue: https://github.com/lzybkr/PSReadLine/issues/673



              I tried deleting history file in ~AppDataRoamingMicrosoftWindowsPowerShellPSReadline which was over 6 GB by then and after that PowerShell console started opening pretty quickly.



              Maybe the slowness you experience is the PowerShell trying to read a big history file (which is not yet big enough to cause OutOfMemory).






              share|improve this answer




























                -1














                I had been experiencing the same issue for quite some time until PowerShell started failing on startup with the following error:



                Exception:
                System.OutOfMemoryException: Array dimensions exceeded supported range.
                at System.Collections.Generic.List`1.set_Capacity(Int32 value)
                at System.Collections.Generic.List`1.EnsureCapacity(Int32 min)
                at System.Collections.Generic.List`1.Add(T item)
                at System.IO.File.InternalReadAllLines(String path, Encoding encoding)
                at Microsoft.PowerShell.PSConsoleReadLine.<ReadHistoryFile>b__67_0()
                at Microsoft.PowerShell.PSConsoleReadLine.WithHistoryFileMutexDo(Int32 timeout, Action action)
                at Microsoft.PowerShell.PSConsoleReadLine.DelayedOneTimeInitialize()
                at Microsoft.PowerShell.PSConsoleReadLine.Initialize(Runspace runspace, EngineIntrinsics engineIntrinsics)
                at Microsoft.PowerShell.PSConsoleReadLine.ReadLine(Runspace runspace, EngineIntrinsics engineIntrinsics)
                -----------------------------------------------------------------------


                This led me to the existing Github issue: https://github.com/lzybkr/PSReadLine/issues/673



                I tried deleting history file in ~AppDataRoamingMicrosoftWindowsPowerShellPSReadline which was over 6 GB by then and after that PowerShell console started opening pretty quickly.



                Maybe the slowness you experience is the PowerShell trying to read a big history file (which is not yet big enough to cause OutOfMemory).






                share|improve this answer


























                  -1












                  -1








                  -1







                  I had been experiencing the same issue for quite some time until PowerShell started failing on startup with the following error:



                  Exception:
                  System.OutOfMemoryException: Array dimensions exceeded supported range.
                  at System.Collections.Generic.List`1.set_Capacity(Int32 value)
                  at System.Collections.Generic.List`1.EnsureCapacity(Int32 min)
                  at System.Collections.Generic.List`1.Add(T item)
                  at System.IO.File.InternalReadAllLines(String path, Encoding encoding)
                  at Microsoft.PowerShell.PSConsoleReadLine.<ReadHistoryFile>b__67_0()
                  at Microsoft.PowerShell.PSConsoleReadLine.WithHistoryFileMutexDo(Int32 timeout, Action action)
                  at Microsoft.PowerShell.PSConsoleReadLine.DelayedOneTimeInitialize()
                  at Microsoft.PowerShell.PSConsoleReadLine.Initialize(Runspace runspace, EngineIntrinsics engineIntrinsics)
                  at Microsoft.PowerShell.PSConsoleReadLine.ReadLine(Runspace runspace, EngineIntrinsics engineIntrinsics)
                  -----------------------------------------------------------------------


                  This led me to the existing Github issue: https://github.com/lzybkr/PSReadLine/issues/673



                  I tried deleting history file in ~AppDataRoamingMicrosoftWindowsPowerShellPSReadline which was over 6 GB by then and after that PowerShell console started opening pretty quickly.



                  Maybe the slowness you experience is the PowerShell trying to read a big history file (which is not yet big enough to cause OutOfMemory).






                  share|improve this answer













                  I had been experiencing the same issue for quite some time until PowerShell started failing on startup with the following error:



                  Exception:
                  System.OutOfMemoryException: Array dimensions exceeded supported range.
                  at System.Collections.Generic.List`1.set_Capacity(Int32 value)
                  at System.Collections.Generic.List`1.EnsureCapacity(Int32 min)
                  at System.Collections.Generic.List`1.Add(T item)
                  at System.IO.File.InternalReadAllLines(String path, Encoding encoding)
                  at Microsoft.PowerShell.PSConsoleReadLine.<ReadHistoryFile>b__67_0()
                  at Microsoft.PowerShell.PSConsoleReadLine.WithHistoryFileMutexDo(Int32 timeout, Action action)
                  at Microsoft.PowerShell.PSConsoleReadLine.DelayedOneTimeInitialize()
                  at Microsoft.PowerShell.PSConsoleReadLine.Initialize(Runspace runspace, EngineIntrinsics engineIntrinsics)
                  at Microsoft.PowerShell.PSConsoleReadLine.ReadLine(Runspace runspace, EngineIntrinsics engineIntrinsics)
                  -----------------------------------------------------------------------


                  This led me to the existing Github issue: https://github.com/lzybkr/PSReadLine/issues/673



                  I tried deleting history file in ~AppDataRoamingMicrosoftWindowsPowerShellPSReadline which was over 6 GB by then and after that PowerShell console started opening pretty quickly.



                  Maybe the slowness you experience is the PowerShell trying to read a big history file (which is not yet big enough to cause OutOfMemory).







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Oct 19 '18 at 7:19









                  takemyoxygentakemyoxygen

                  99




                  99






























                      draft saved

                      draft discarded




















































                      Thanks for contributing an answer to Super User!


                      • Please be sure to answer the question. Provide details and share your research!

                      But avoid



                      • Asking for help, clarification, or responding to other answers.

                      • Making statements based on opinion; back them up with references or personal experience.


                      To learn more, see our tips on writing great answers.




                      draft saved


                      draft discarded














                      StackExchange.ready(
                      function () {
                      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1212442%2fpowershell-slow-starting-on-windows-10%23new-answer', 'question_page');
                      }
                      );

                      Post as a guest















                      Required, but never shown





















































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown

































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown







                      Popular posts from this blog

                      Probability when a professor distributes a quiz and homework assignment to a class of n students.

                      Aardman Animations

                      Are they similar matrix