Getting Your Hands on PowerShell 7 - #PS7Now
Posted on March 7, 2020 • 5 minutes • 998 words
This post is part of the #PS7Now PowerShell Blog Week celebrating the general availability launch of PowerShell 7.
There's a lot of great content coming out this week from a number of different authors, so make sure you keep an eye on the hashtag over on Twitter or checkout the table at the bottom of this post for direct links!
It’s finally here!
It was April of 2019, just after the Generally Available release of PowerShell Core 6.2, when the PowerShell team announced that the next release of would be known as PowerShell 7.
There were two things that surprised people in that announcement, the first being that the next version number wouldn’t just increment up to 6.3. Secondly, where’d that quantifier “Core” disappear to?
Since then, we’ve had six preview releases and 2 release candidates. There’s been a huge number of community contributions and epic work from the PowerShell team.
Thanks to all the effort put in by so many people, Windows admins that have been bound to Windows PowerShell 5.1 can finally make the move over to the opensource version of their favorite (I assume!) management tool. This move allows them to benefit from all the new features that have been built in since development shifted from being focused solely on Windows. This should be reasonably frictionless[1] due to greater compatibility (compared to 6.2).
But before all of the new features are explored by others throughout this blog week, we’ll have a look at getting it installed.
Install Manually
Our first option for installing PowerShell 7 is to grab the relevant installer from GitHub . Chances are if you’re installing on Windows you’ll want to grab the x86 or x64 MSI file. Download and run that, click through the wizard and you’re ready to rock.
If you’re wanting to do a manual install on Linux or Mac… I’m not sure this is the best path to take. Instead, check out the docs about how to install on your distribution of choice.
Note, the install does it’s best to remove any existing installs of PowerShell Core 6.x, but will leave PowerShell 7 Preview installs untouched. You may want to go ahead and remove the preview installs yourself if you were following them.
It’s Portable
I wanted to call out here that PowerShell 7 is technically portable. The GitHub releases page has zipped versions of the Windows releases which you can extract and… put anywhere and then run pwsh.exe
.
PowerShell 7 won’t be on your path by default if you go this route but it does give you complete control.
Scripted Install
There are a pair of scripts available to automatically install the latest PowerShell version available.
On Windows, run the following command in a PowerShell console:
iex "& { $(irm https://aka.ms/install-powershell.ps1) } -UseMSI"
In the interest of completeness, and because I hate leaving aliases there let’s just note the two in that snippet:
iex
=Invoke-Expression
irm
=Invoke-RestMethod
This time, I can be a little more helpful for those on Linux. While it’s not the same script, it’s just as simple to run:
wget https://aka.ms/install-powershell.sh; sudo bash install-powershell.sh
Execute this in your terminal of choice, unlike the Windows option you don’t already need PowerShell.
The Microsoft Store?!
The newest option that’s been (being?) introduced for PowerShell 7 is the ability to install it as an app from the Microsoft store.
To get it, search for PowerShell and install it. The app will be from “Microsoft Corporation” and be under the developer tools category. Remember, there’s no “Windows” or “Core” in the name anymore… just PowerShell.
At the time of writing the live version of PowerShell 7 isn’t yet available, but I can attest to the Preview working rather well.
At least during the preview, the app was able to live alongside the MSI version, which in turn can happily live alongside Windows PowerShell.
In practice, I found it better to choose either the store version or the MSI version as I wasn’t always 100% sure which I was opening (you can tell, you just need to pay closer than normal attention.)
The benefit to installing from the store is that you’ll get automatic updates as they are released, though it’s possible they may be slower (due to verification of the packages) than the general releases to GitHub.
The preview versions did have some issues related to resource virtualization. The hope is that this has been resolved, but we won’t know for sure until the next version is up on the Store.
One Final Option
There’s one last option I wanted to include, as I know someone would give me a hard time if I left it out: Chocolatey .
If you work on Windows and haven’t heard about and installed Chocolatey, fix that .
It’s a tool that allows you to install, update, and otherwise manage software on Windows much like our friends on Linux can with their package managers.
To install PowerShell 7 using Chocolatey , run:
choco install powershell-core
You’ll note that the command mentions “PowerShell Core”, that’s a hangover from this package being how the previous releases were made available and keeping that name allows existing users to easily update.
It’s possible that this will change to just powershell
in the future or that the more “correct” name is added in addition.
More to Come
Regardless of the method chosen, you’ll now be up and running on PowerShell 7. Follow the #PS7Now hashtag on Twitter for more about this exciting release or check out the other blog week authors directly.
Author | Blog | |
---|---|---|
Adam Bertram | @adbertram | https://adamtheautomator.com |
Dan Franciscus | @dan_franciscus | https://winsysblog.com |
Dave Carroll | @thedavecarroll | https://powershell.anovelidea.org |
Jeff Hicks | @JeffHicks | https://jdhitsolutions.com |
Jonathan Medd | @jonathanmedd | https://www.jonathanmedd.net |
Josh Duffney | @joshduffney | http://duffney.io |
Mike Kanakos | @MikeKanakos | https://www.commandline.ninja |
Prateek Singh | @singhprateik | https://ridicurious.com |
Thomas Lee | @doctordns | https://tfl09.blogspot.com |
Credit
Hero image by Erin King
Footnotes
1. Yes, there are some scripts that won't work in PS7 or will require some work. Don't feel like you have to transition completely and never look back.
comments powered by Disqus