This article is contributed. See the original author and article here.

In this post I will demonstrate how to install the PowerShell Core 7.0.3 on Windows Terminal.

 

I am assuming that you already have Windows Terminal and a Linux distribution installed. Please check the following posts in case you need more details about how to install Windows Terminal and a Linux distro:

 

Using WSL2 in a Docker Linux container on Windows to run a Minecraft Java Edition

https://techcommunity.microsoft.com/t5/windows-dev-appconsult/using-wsl2-in-a-docker-linux-container-on-windows-to-run-a/ba-p/1482133

 

logo.png

 

Installing .NET Core 3.1 on Windows 10

 

Please skip this session in case you already have .NET Core 3.1 SDK installed on Windows 10.

 

As PowerShell Core is developed in .NET Core 3.1, it is necessary to install .NET Core SDK available at:

https://dotnet.microsoft.com/download/dotnet-core/3.1

 

You need to choose an version according with your processor architecture:

 

dotnet sdk msi windows 2.png

 

 

 

 

I am using the x64 version:

 

https://dotnet.microsoft.com/download/dotnet-core/thank-you/sdk-3.1.302-windows-x64-installer

 

 

install .net core sdk.png

 

 

 

The next step is to install the PowerShell Core on Windows.

 

Installing PowerShell Core 7.0.3 on Windows 10

 

Now that .NET Core 3.1 SDK is installed, the next step is to install PowerShell Core 7.0.3 available for download at:

 

https://github.com/PowerShell/PowerShell/releases/tag/v7.0.3

 

Please selected a version according to your operating system and processor architecture:

 

pwsh msi windows.png

 

 

 

I am using the PowerShell-7.0.3-win-x64.msi to install on Windows 10:

 

new ps.png

 

 

 

Once installed, open a new version of Windows Terminal and observe that PowerShell Core is installed:

 

Pwsh installed wt.png

 

Initial prompt:

 

new ps3.png

 

 

 

Installing .NET Core 3.1 on WSL

 

Please skip this session in case you already have .NET Core 3.1 installed on WSL.

 

As PowerShell Core is developed in .NET Core 3.1, it is necessary to install .NET Core SDK available at: 

 

https://dotnet.microsoft.com/download/dotnet-core/3.1

 

As I am using a 64-bit machine and the Ubuntu distro, I will install the x64 version available at:

 

https://dotnet.microsoft.com/download/dotnet-core/thank-you/sdk-3.1.301-linux-x64-binaries

 

Run the following commands to download and to extract the package :

 

wget https://dotnet.microsoft.com/download/dotnet-core/thank-you/sdk-3.1.301-linux-x64-binaries
sudo dpkg -i packages-microsoft-prod.deb

 

linux net core p1.png

 

Run the following commands to install .NET Core SDK:

 

mkdir -p $HOME/dotnet && tar zxf dotnet-sdk-3.1.301-linux-x64.tar.gz -C $HOME/dotnet
export DOTNET_ROOT=$HOME/dotnet
export PATH=$PATH:$HOME/dotnet

 

Run dotnet to double-check if .NET Core SDK was successfully installed:

 

net core install.png

 

More details at:

https://dotnet.microsoft.com/download/dotnet-core/thank-you/sdk-3.1.302-linux-x64-binaries

 

Installing PowerShell 7.0.3 on WSL

 

Now that .NET Core 3.1 SDK is installed on WSL, the next step is to install PowerShell 7.0.3 whose installers are available for download at:

 

https://github.com/PowerShell/PowerShell/releases/tag/v7.0.3

 

url.png

 

 

I will install the powershell_7.0.3-1.ubuntu.18.04_amd64.deb, as I am using the Ubuntu distro.

 

Run the following command to download the package. Please make sure that you are using the file associated to you Linux distro.

 

wget https://github.com/PowerShell/PowerShell/releases/download/v7.0.3/powershell_7.0.3-1.ubuntu.18.04_amd64.deb

 

pwsh download deb.png

 

Once you have the package, run the following command to install it:

 

sudo dpkg -i powershell_7.0.3-1.ubuntu.18.04_amd64.deb

 

Follows the expected result:

 

pwsh installed ubuntu.png

 

Run the following command to launch PowerShell Core on Linux:

 

pwsh

 

pwsh bash.png

 

 

Done. Now you have PowerShell Core installed on Windows and WSL.

 

I hope you liked!!!!

Brought to you by Dr. Ware, Microsoft Office 365 Silver Partner, Charleston SC.