Upgrading PowerShell to version 7.2.5 from WindowsPowerShell 5.1 (Windows default)

I have subscribed to US-CERT Security Advisories, and several other related security advisory mailing lists for more years than I can count. Today, I received an Advisory from US-CERT titled ‘Keeping PowerShell: Measures to Use and Embrace, with a link to a PDF document of the same title, at ‘Keeping PowerShell: Measures to Use and Embrace | CISA’. In and of itself, this document is probably not of much interest to most home Windows 10 or 11 users, but reading it informed me that there is a newer and possibly more secure version of PowerShell available to the general public. The document linked above was not very clear about that, but the suggestion was there. I make it a policy to keep all the software on my computers as up to date as possible, based on the information I have at any given point in time, so when I learned that there is a newer version of PowerShell available, of course, I had to get it.

WindowsPowerShell 5.1 comes preinstalled in Windows 10 and 11. Since it is needed by some Windows components (ironically, including the new version of PowerShell), it cannot be uninstalled. PowerShell 7.2.5 (and future versions) is/are designed to run alongside WindowsPowerShell 5.1, using some of its features and functionality when needed while providing the enhancements hinted at in the document linked above.

Note: You can check which PowerShell version you are using by entering this command at the PowerShell prompt: $PSVersionTable

Since the document did not indicate how to get the new PowerShell, I performed an Internet search for “windows 11: upgrade powershell to version 7.2”. How to install PowerShell 7.2 on Windows 11 – Pureinfotech was the first item in the results list. It describes three ways to get PowerShell version 7.2.5. I will provide a synopsis of each method below:

First method: ‘Get PowerShell 7.2.5 from GitHub’:

  1. In your web browser, go to the PowerShell GitHub page.

  2. Scroll down to the Assets section.

  3. In the Assets section, click ‘PowerShell-7.2.x-win-x64.msi’ (the current version at this writing is 7.2.5) to download it.

  4. Open File Explorer and navigate to the Downloads folder.

  5. In the Downloads folder, execute PowerShell-7.2.x-win-x64.msi by clicking the file.

  6. Follow the installer’s prompts to install PowerShell.

Second method: ‘Get PowerShell 7.2.5 form the Microsoft Store:

  1. Open the Microsoft Store app.

  2. In the search box (at the top-center), enter ‘PowerShell’ (no quotes) then press ‘Enter’.

  3. PowerShell will probably be the first item in the results list, click the ‘Get’ button at the right.

  4. PowerShell will download and install.

Third method: ‘Get PowerShell 7.2.5 using the winget command:

  1. In Windows Search, enter ‘cmd

  2. In the search results, ALT-Click the ‘Command Prompt’ item and select ‘Run as Administrator’, then click ‘Yes’ in the User Account Control dialog.

  3. At the command prompt, enter winget install -id Microsoft.PowerShell. This command reports that it has downloaded PowerShell 7.2.0.0 (it actually gets PowerShell 7.2.5 - just like the other methods), then it reports whether the installer hash could successfully be verified, if so, PowerShell is installed. When installation finishes, success or failure is reported.

After installation, you can make PowerShell 7.2.5 the default (requires Microsoft terminal App):

Set PowerShell 7.2.x as the default:

  1. Open PowerShell in the Terminal App.

  2. Click the drop-down icon (˅) at the right of the new tab icon (+), select 'Settings' 

  3. In 'Default profile', if Windows PowerShell is displayed, click the drop-down icon (˅) then select 'PowerShell' to make PowerShell 7.2.5 the default Click.

  4. Click the 'Save' button at the bottom-right of the window to save your changes.

Comments

Popular posts from this blog

Common Debian App Commands With Descriptions

Here is what I do to remain safe on (and off) the Internet

Windows–Linux dual-booters: how to set Windows system time to UTC