3 ms·
You should not be using the Powershell that comes bundled with Windows. It's slow and only updated with major system upgrades. Install the open source version:
by abdusco 5y ago
You should not be using the Powershell that comes bundled with Windows. It's slow and only updated with major system upgrades. Install the open source version: `dotnet install powershell`.
Having said that, Powershell suffers from the same problem as .NET: slow startup. It's improved massively in the last few versions and I think it will get even faster once it's built using NativeAOT in .NET 7. But it can also never be as fast as .NET, since it's interpreted. So there's that.
- ripley12 5y ago> Powershell suffers from the same problem as .NET: slow startup This is a popular belief but I don't think it's true that .NET has slow startup. The CLR starts up in milliseconds, the JIT's first-tier compilation is crazy fast, and if you need to it's trivial to ship precompiled code using ReadyToRun. I don't know what makes PowerShell so slow to start up but I wouldn't blame it on .NET without more evidence.
- majkinetor 5y agoPowerShell is not the fastest beast around but its not slow as some people try to portray it regularly. In my experience it usually boils down to: 1. Windows defender (it slows down any file access by the factor of 10 at least) 2. Virtual machine / VDI (I had 5-10s startup time on my VDI) 3. Slow modules to load (particularly those that source ps1 files instead having everything in psm1, but this is easy to diagnose as you can start it without modules) Other then that, I never had startup time longer then 1s with bunch of modules. While that is not ultra fast, its not slow either. I must have been using it on thousand+ different machines and OSes. Furthermore, its incomparable to bash, since once started, you rarely have to load any external processes. As an example to get something from REST API and sort and convert to CSV you can use only pwsh cmdlets, while in bash you need to use curl, jq, sort, awk etc. just for this one command. So such scripts must be slower, particularly on Windows where processes are more expensive.