Зарегистрируйтесь сейчас для лучшей персонализированной цитаты!

Новости по теме

How to install and use Microsoft's PowerShell on Linux (and why you should)

Dec, 25, 2024 Hi-network.com
Microsoft/Ubuntu

PowerShell is a task automation and configuration management tool, designed and released by Microsoft, that consists of a command-line shell and a powerful scripting language. A lot of intermediate and advanced Windows users depend on this application for many different reasons and are probably concerned about what they'll do when support for Windows 10 ends next year.

Also: The best Linux distribution of 2024 is MacOS-like but accessible to all

For those whose computers won't support Windows 11, there's good news: Linux!

And for those who depend on PowerShell, there's even better news:

You can install PowerShell on Linux. Let me show you how.

How to install PowerShell on Ubuntu-based distributions

What you'll need: To make this work, you'll need a running instance of a Ubuntu-based distribution and a user with sudo privileges. That's it. Let's make some magic.

1. Log into Linux

The first thing to do is log into your Linux desktop and open the terminal application.

Show more

2. Install the required dependencies

There are a few dependencies that must first be installed, which can be done with a single command:

sudo apt-get install -y wget apt-transport-https software-properties-common -y

Show more

3. Download the Microsoft repository keys

Next, we need to download the proper keys so the MS repository can be used. This is done with the following three commands:

source /etc/os-release
wget -q https://packages.microsoft.com/config/ubuntu/$VERSION_ID/packages-microsoft-prod.deb
sudo dpkg -i packages-microsoft-prod.deb

The first command above copies the release version of your distribution into memory, the second downloads the correct key for your version, and the third command installs the key.

Show more

Also: Why I no longer recommend this Windows-like Linux distro

4. Install PowerShell

Update apt with the command:

sudo apt-get update

Finally, install PowerShell with:

sudo apt-get install powershell -y

Show more

How to install PowerShell on Fedora-based distributions

When using a Fedora-based distribution, the installation process looks like this.

1. Import the required security key

sudo rpm --import https://packages.microsoft.com/keys/microsoft.asc

First, you'll need to import the necessary security key with the command:

2. Download and add the repository

You can then download and add the required MS repository with a single command:

curl https://packages.microsoft.com/config/rhel/7/prod.repo  sudo tee /etc/yum.repos.d/microsoft.repo

3. Install PowerShell

PowerShell can now be installed with the following two commands:

sudo dnf makecachesudo dnf install powershell -y

How to install PowerShell on Arch-based distributions

Finally, we'll install Powershell on Arch-based Linux distributions. Surprisingly, this is the easiest installation because PowerShell can be installed from AUR (Arch User Repository) with two simple commands:

pacman -Syypacman -Ss powershell-bin

How to start PowerShell

Now that you have PowerShell installed, you can start it with the command:

pwsh

You should now find yourself on the familiar PowerShell prompt, where you can start using this powerful tool as you did in Windows 10.

Also: The 3 most Windows-like Linux distros you can try because change is hard

Open Source

10 Linux apps I can't do without - and whyLinux and open-source documentation is a mess: Here's the solution6 ways LibreOffice is better than Google Docs for serious writing workThe Linux file system structure explained
  • 10 Linux apps I can't do without - and why
  • Linux and open-source documentation is a mess: Here's the solution
  • 6 ways LibreOffice is better than Google Docs for serious writing work
  • The Linux file system structure explained

tag-icon Горячие метки: Технологии и оборудование Услуги и программное обеспечение 3. Операционные системы

Copyright © 2014-2024 Hi-Network.com | HAILIAN TECHNOLOGY CO., LIMITED | All Rights Reserved.
Our company's operations and information are independent of the manufacturers' positions, nor a part of any listed trademarks company.