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:
- Download the script from my GitHub by clicking here
- Open a PowerShell-prompt as an administrator
- Run the script using .\install-pscore.ps1 and parameters if needed. Use -verbose to see logging
- 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.