How to install Microsoft PowerShell 6.2.0 on Ubuntu 18.04

How to install Microsoft PowerShell 6.2.0 on Ubuntu 18.04

Install Microsoft PowerShell 6.2.0 on Ubuntu 18.04

Microsoft PowerShell is an open source cross-platform tool that includes an interactive command line shell and scripting environment. Microsoft PowerShell was developed to perform configuration management and automate repetitive tasks. On Ubuntu, you can install the Microsoft PowerShell package using: snappy Package manager. In this tutorial, you will learn how to install Microsoft PowerShell 6.2.0 on Ubuntu 18.04.

Precondition

Before installing Microsoft PowerShell 6.2.0 on Ubuntu 18.04. The system requires a non-root user account with sudo privileges.

Install PowerShell on Ubuntu

Microsoft PowerShell makes it available to Ubuntu users. snap package. Install using snappy Package manager.

First, press to open the terminal application Ctrl+Alt+t Key at the same time.

Update now apt Enter the following command in a terminal to index the package manager:

sudo apt update

Then you need to install snapd And snapd-xdg-open Package to install Snappy package manager if not installed on the system. To install Snappy package manager on your system, run the following command in a terminal:

sudo apt install snapd snapd-xdg-open

After installing Snappy Package Manager, you are ready to install Microsoft PowerShell. To install the Microsoft PowerShell Classic version, you need to run the following command:

sudo snap install powershell –classic

The above command will prompt for authentication. Enter your authentication password to continue.

The output looks like this:

powershell 6.2.0 from 'microsoft-powershell' installed

You have successfully installed Microsoft PowerShell on your system.

Start Microsoft PowerShell

You can install Microsoft PowerShell using one of two methods: Activities -> type - Microsoft Powershell Click the launcher icon when it appears.

You can also start PowerShell using the terminal application using the following command:

powershell

Make sure PowerShell is installed correctly

To confirm that Microsoft PowerShell is installed correctly, execute the following PowerShell command.

$PSVersionTable

Conclusion

You learned how to install Microsoft PowerShell 6.2.0 on Ubuntu 18.04. If you have any questions about this, don’t forget to comment below.

Sidebar