According to the user’s perspective, Microsoft has offered a program we know as PowerShell that is built on Microsoft .Net Framework. Powershell is a scripting language that automates administrative tasks through an interactive session with command-line shell.
It is a cross-platform program consisting of a modern command shell. It handles administrative tasks and configuration management through cmdlets which are pronounced as command-lets. Powershell is also a scripting language that can create classes, scripts, test and deploy solutions.
Install Powershell on Linux Mint 21
Powershell is an open-source program supported by different operating systems including Linux. The guide will show you how you can install it on the Linux Mint 21 system with the help of two different approaches.
Let’s perform both approaches and find out which is the easier one.
i: Install Powershell on Linux Mint via apt
To install PowerShell using apt repository, we need to install Microsoft keys and repository first. The few mentioned-below commands are need to be followed carefully:
Step 1: Upgrade the Linux Mint 21 system using the given command to update all system packages:
Step 2: Next step is to install the required dependencies that helps to run PowerShell on Linux Mint:
Step 3: Now, add the Microsoft GPG key:
Step 4: Import the repository to the Linux Mint system:
Step 5: Refresh the system’s packages:
Step 6: Now, we can install PowerShell on the Linux Mint 21 after successfully installing repositories and keys. Run the mentioned command to let installation begin:
Step 7: Run the PowerShell on Linux Mint system by typing pwsh on terminal:
ii: Install PowerShell on Linux Mint 21 via Snap
Snap packages are another way to install PowerShell on the Linux Mint 21 system. For this, we need to ensure if snap package manager exists in our system by running the command:
If it is not enabled then read the guide to enable snap on Linux Mint.
Now, with the help of the following snap command you can install PowerShell on system:
You can launch it on system by running pwsh on terminal:
Uninstall Powershell from Linux Mint 21
We can also uninstall or delete PowerShell from Linux Mint 21 system using following methods:
i: Delete PowerShell from Linux Mint using apt
To delete PowerShell from Linux Mint 21 system, executing the command given-below:
Also, we need to remove the added repositories and GPG keys from the system. You can do this by copying the mentioned command in terminal:
ii: Delete PowerShell from Linux Mint using Snap
To remove PowerShell through snap packages, execute the following command:
PowerShell is the popular program from Microsoft for task automation. It performs operations using a command shell and reduces the problem of repetitive tasks. PowerShell is the advanced update of CMD that comes with more enhancing features in it. This article has covered two ways to install PowerShell in Linux Mint 21 system i-e through apt repository and through snap packages.