5 ms·
Sadly, the powershell windows ships with is 5.1. Why? Because of backwards Compatibilytytytyy
by arka2147483647 3y ago
Sadly, the powershell windows ships with is 5.1.
Why?
Because of backwards Compatibilytytytyy
- WorldMaker 3y ago`winget install Microsoft.PowerShell` 5.1 was the last "Windows-specific"/"Windows-only" PowerShell (and is still branded "Windows PowerShell" more than "PowerShell") before it went full cross-platform (and open source). It's an easy install for PowerShell 7+ and absolutely worth installing. If you are using tools like the modern Windows Terminal and VS Code they automatically pick up PowerShell 7+ installations (and switch to them as default over the bundled "Windows PowerShell"), so the above command line really is the one and only step.
- pxc 3y agoYou can also install the latest PowerShell Core (the open-source, cross-platform releases we're talking about) via Scoop, which is a package manager for Windows that works even if you don't have admin rights: https://scoop.sh/#/apps?q=pwsh&s=0&d=1&o=true https://scoop.sh/#/apps?q=pwsh&s=0&d=1&o=true
- maccard 3y agoUnless I can rely it being somewhat available, it's not really feasible to use. It's a bit like writing scripts in fish because it's easily installable - nobody is going to use it. Winget isn't bundled with windows 10 either, (but I think it is with 11), and it's not on windows server. If I need to install a package manager _and_ a shell, I might as well just install WSL and be done with it.
- WorldMaker 3y agoWinget is auto-installed in Windows 10 by Windows Update and/or Store Update for every copy of Windows 10 with a recent enough build for more than a year or two, so long as that machine doesn't have the Store disabled or blocked. It is bundled inside the "Application Installer Platform" which is a low-level Store package that powers a lot of little things like the "double-click to install an MSIX file" experience and Windows generally keeps up to date quickly if Store updates aren't blocked. I can't speak to your usage of Windows Server, but provisioning winget and PowerShell 7+ are standard bootstrapping steps in VM images at places I work, because those are generally assumed to be basic equipment at this point.