{"id":26765,"date":"2022-05-02T19:47:40","date_gmt":"2022-05-02T19:47:40","guid":{"rendered":"http:\/\/activedirectorypro.com\/?p=26765"},"modified":"2022-10-07T12:03:42","modified_gmt":"2022-10-07T12:03:42","slug":"update-powershell-version","status":"publish","type":"post","link":"https:\/\/activedirectorypro.com\/update-powershell-version\/","title":{"rendered":"Update PowerShell to the Latest Version"},"content":{"rendered":"\n
In this tutorial, you will learn how to update PowerShell on Windows to the latest version. I’ll also show you how to upgrade PowerShell version 5.1 to PowerShell Core 7.<\/p>\n\n\n\n
If you are new to PowerShell it can be confusing to know that there are two different versions. I’ll explain the difference and which version you should be using. <\/p>\n\n\n\n
I reference the two PowerShell versions as the original PowerShell <\/strong>(old) and PowerShell Core<\/strong> (new).<\/p>\n\n\n Contents:<\/strong><\/p>\n\n\n\n Microsoft has created a mess in my opinion. <\/p>\n\n\n\n Microsoft released PowerShell for Windows in 2006 and it has become very popular with the Windows community. In 2016 Microsoft released a new PowerShell version that is open source and cross-platform, this version is called “PowerShell Core”. PowerShell was originally created as a scripting language for Microsoft systems. Then Microsoft makes it cross-platform because Linux doesn’t have a scripting language? Anyways, that is beyond the scope of this article. <\/p>\n\n\n\n Here are the key differences:<\/strong><\/p>\n\n\n\n Here are the steps for updating to the latest original PowerShell version 5.1. In this example, I have a 2012 Windows Server that comes with PowerShell version 4.0. <\/p>\n\n\n\n You can quickly check your PowerShell version with the command below: <\/p>\n\n\n\n In the screenshot above you can see my server is running PowerShell version 4. <\/p>\n\n\n\n Here are the steps to upgrade to PowerShell 5.1<\/p>\n\n\n\n Step 1: <\/strong>Download Windows Management Framework 5.1<\/p>\n\n\n\n Click here to download WMF 5.1 from Microsoft<\/a>. <\/p>\n\n\n\n Note: <\/strong>WMF 5.1 requires .NET Framework 4.5.2 (or above). You can install WMF 5.1 on server 2012 without .NET 4.5.2 but key PowerShell features will fail until you upgrade. <\/p>\n\n\n\n On the download page pick the install file for your operating system. <\/p>\n\n\n\n Step 2:<\/strong> Install and Reboot<\/p>\n\n\n\n Next, install the WMF 5.1 package. This will require a reboot. <\/p>\n\n\n\n All done. Now open PowerShell and check the version again. <\/p>\n\n\n\n Windows 10 (1607 and up) and Windows 11 come with PowerShell 5.1 by default so no need to upgrade. Windows Server 2016 and later also come with PowerShell 5.1. <\/p>\n\n\n\n PowerShell Core is a different platform than the original Windows PowerShell. This means you cannot upgrade the original PowerShell to PowerShell Core 7. PowerShell Core will install separately from the original PowerShell and runs side by side. <\/p>\n\n\n\n In this example, I will install the latest version of PowerShell 7 on a Windows 10 computer. This will install alongside the original PowerShell 5.1 that is already installed with Windows 10. <\/p>\n\n\n\n Step 1:<\/strong> Download PowerShell Core On the download page look at the right-hand side and you will see a releases section. Click on the latest release version. <\/p>\n\n\n\n Then scroll down to Assets and pick the file that matches your OS. <\/p>\n\n\n\n I’m downloading the win-x64 installer. As you can see there are installer files for other operating systems such as Linux. <\/p>\n\n\n\n Step 2: <\/strong>Install PowerShell Core<\/p>\n\n\n\n Next, run the installer file. It will walk you through an install wizard. <\/p>\n\n\n\n When complete you will have PowerShell Core and the original PowerShell 5.1 installed. <\/p>\n\n\n\n To check which version you have installed you will need to open them separately and run the $PSVersionTable command. <\/p>\n\n\n\n Above you can see the PowerShell Core version on the left and the original on the right. <\/p>\n\n\n\n A faster option for installing PowerShell Core is to use the Winget command. <\/strong><\/p>\n\n\n\n First, search for the latest PowerShell version with the command below. <\/p>\n\n\n\n Next, Install PowerShell by using the ID from the command output. <\/p>\n\n\n\n If you have PowerShell 6 installed, you can directly update to the latest version of PowerShell 7. <\/p>\n\n\n\n Kind of a mess hu? <\/p>\n\n\n\n Well if you have used Microsoft for very long, you know they change stuff up all the time. It can be frustrating, but there is not much you can do about it. <\/p>\n\n\n\n Since Microsoft provides PowerShell Core as an MSI file you can use group policy to deploy it to multiple computers. <\/p>\n\n\n\n I wrote a guide on how to deploy software using group policy<\/a> that includes step by step instructions and examples. It’s very easy here is a quick summary of the article. <\/p>\n\n\n\n If you use a 3rd party product to push out updates and software packages then I’d recommend using that over group policy. <\/p>\n\n\n\n PowerShell 5.1 is still installed by default on Windows client and server operating systems. Microsoft has no plans to remove 5.1, it will be around for a long time. <\/p>\n\n\n\n Unless PowerShell 7 introduces a needed feature or fix then you should be fine sticking with 5.1. It does include several performance improvements so that might be a reason alone to upgrade. <\/p>\n\n\n\n If you want to move to PowerShell 7 then make sure you test…..test and test. Who knows what it might break, it might not be compatible with a module provided by a vendor or one you created so testing is critical. Microsoft has a module compatibility list <\/a>of modules known to support PowerShell 7. <\/p>\n\n\n\n I don’t recommend upgrading every machine to 7 just to be on the latest version. I would only upgrade when needed. For personal use however, I see no problem with upgrading to PowerShell 7. <\/p>\n\n\n\n PowerShell 7 does include many features that are long overdue. <\/p>\n\n\n\n Yes, but the original PowerShell 5.1 is installed by default. You can use the steps in this guide to install PowerShell core on Windows 11. <\/p>\n\n\n\n There you have it. That is how you update PowerShell to the latest version. <\/p>\n\n\n\n Do you use PowerShell 7 or still use 5.1? Let me know in the comments below. <\/p>\n","protected":false},"excerpt":{"rendered":" In this tutorial, you will learn how to update PowerShell on Windows to the latest version. I’ll also show you how to upgrade PowerShell version 5.1 to PowerShell Core 7. If you are new to PowerShell it can be confusing to know that there are two different versions. I’ll explain the difference and which version … Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":26795,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[18],"tags":[],"_links":{"self":[{"href":"https:\/\/activedirectorypro.com\/wp-json\/wp\/v2\/posts\/26765"}],"collection":[{"href":"https:\/\/activedirectorypro.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/activedirectorypro.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/activedirectorypro.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/activedirectorypro.com\/wp-json\/wp\/v2\/comments?post=26765"}],"version-history":[{"count":3,"href":"https:\/\/activedirectorypro.com\/wp-json\/wp\/v2\/posts\/26765\/revisions"}],"predecessor-version":[{"id":32776,"href":"https:\/\/activedirectorypro.com\/wp-json\/wp\/v2\/posts\/26765\/revisions\/32776"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/activedirectorypro.com\/wp-json\/wp\/v2\/media\/26795"}],"wp:attachment":[{"href":"https:\/\/activedirectorypro.com\/wp-json\/wp\/v2\/media?parent=26765"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/activedirectorypro.com\/wp-json\/wp\/v2\/categories?post=26765"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/activedirectorypro.com\/wp-json\/wp\/v2\/tags?post=26765"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}PowerShell 5.1 vs PowerShell Core 7<\/h2>\n\n\n\n
Update PowerShell to Version 5.1 <\/h2>\n\n\n\n
$PSVersionTable.PSVersion<\/code><\/pre>\n\n\n\n
<\/figure>\n\n\n\n
<\/figure>\n\n\n\n
$PSVersionTable<\/code><\/pre>\n\n\n\n
<\/figure>\n\n\n\n
How to Upgrade to PowerShell Core 7<\/h2>\n\n\n\n
Download page
https:\/\/github.com\/PowerShell\/PowerShell<\/a><\/p>\n\n\n\n<\/figure>\n\n\n\n
<\/figure>\n\n\n\n
<\/figure>\n\n\n\n
<\/figure>\n\n\n\n
<\/figure>\n\n\n\n
winget search Microsoft.PowerShell<\/code><\/pre>\n\n\n\n
winget install --id Microsoft.Powershell --source winget<\/code><\/pre>\n\n\n\n
Update PowerShell Core 6.x to PowerShell 7<\/h3>\n\n\n\n
Update PowerShell on Multiple Computers (GPO)<\/h2>\n\n\n\n
Frequently Asked Questions<\/h2>\n\n\n\n
Should I use Powershell 5.1 or PowerShell Core 7? <\/h3>\n\n\n\n
Why upgrade to PowerShell Core 7?<\/h3>\n\n\n\n
Does Windows 11 have PowerShell Core?<\/h3>\n\n\n\n