Menu Close

Script: Download and install powershell Core

Last week, I saw a tweet that my colleague Jos has placed on his feed:

The first thing that came to my mind is the fact that you have to install PowerShell Core manually. Not just that, you have to click through a setup menu.
So I could have been lazy (probably should have) and just answered that to the tweet.
But I knew something that was more fun. Let’s automate this!

So I wrote a script that can be run in Windows PowerShell and will Download and install PowerShell core. To make sure it has the latest version, it does a search on the GitHub page where Microsoft publishes.

How to use:

  1. Download the script from my GitHub by clicking here
  2. Open a PowerShell-prompt as an administrator
  3. Run the script using .\install-pscore.ps1 and parameters if needed. Use -verbose to see logging
  4. And you (hopefully) are done.

Use PowerShell Core in Visual Studio Code

If you want to use Core in Visual Studio Code, you need to do something extra, as it defaults to 5.1.

Open Studio code and just click the 5.1.

A menu will open, asking you if you want to use another kind of PowerShell. You can switch back as needed.

 

Hope you enjoy.

3 Comments

  1. Pingback:Introducing WindowsCompatibility for PowerShell Core – >_ pwsh

  2. Pingback:Powershell Challenge: Check if a new Powershell Core version is available and install it after confirmation – 4bes.nl

Leave a Reply

Your email address will not be published. Required fields are marked *