Last active 1720182742

pwsh.sh Raw
1#!/bin/bash
2###################################
3# Prerequisites
4
5# Update the list of packages
6sudo apt-get update
7
8# Install pre-requisite packages.
9sudo apt-get install -y wget apt-transport-https software-properties-common
10
11# Get the version of Ubuntu
12source /etc/os-release
13
14# Download the Microsoft repository keys
15wget -q https://packages.microsoft.com/config/ubuntu/$VERSION_ID/packages-microsoft-prod.deb
16
17# Register the Microsoft repository keys
18sudo dpkg -i packages-microsoft-prod.deb
19
20# Delete the Microsoft repository keys file
21rm packages-microsoft-prod.deb
22
23# Update the list of packages after we added packages.microsoft.com
24sudo apt-get update
25
26###################################
27# Install PowerShell
28sudo apt-get install -y powershell
29
30# Start PowerShell
31pwsh