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.