How to Use PowerShell Core on Linux Virtual Machines

In this article we will try to teach you how to Use Microsoft PowerShell Core on Linux Virtual Machines. PowerShell is an object-oriented automation engine and scripting language with an interactive command-line shell developed by Microsoft to help IT professionals configure systems and automate management tasks. PowerShell, built on top of the .NET framework, works with objects, while most command-line shells are text-based. Due to its scripting capabilities, PowerShell serves as an automation tool for system administrators, used both in IT departments and in external entities such as managed service providers.

PowerShell is an open source shell and scripting language built on top of Microsoft .NET technology. It aims to help tech professionals, who may not be software developers, create efficient scripts and tools to help them do their jobs better. Developed from languages ​​like VBScript and batch files, PowerShell was designed to provide a premium command line interface and scripting language that is easy to understand and use. Below we have mention the steps to install Microsoft PowerShell Core on Linux Virtual Machines.

How to Install PowerShell Core on Linux Virtual Machines

The system we installed PowerShell on was an Ubuntu 16.04, 2 vCPU, 4GB virtual machine (VM) with a 50GB virtual disk running on a Dell PowerEdge R610. The only applications installed, apart from the basic Ubuntu server package, were openssh-server and Lynx (a command line browser). These two programs were installed on Ubuntu by running:

apt-get install lynx

apt-get install openssh-server

We completed the installation, configuration, and running of PowerShell and PowerCLI in the bash shell as root by running:

sudo bash

Installing from GitHub

Because PowerShell was initially released on GitHub, we’ll first walk through how we installed it using the PowerShell GitHub repository.

Step 1: We used Lynx to find and download the package for installing PowerShell on Ubuntu 16.04 from the PowerShell for Linux project page on GitHub. Started Lynx pointing to the PowerShell GitHub repository by running:

lynx https://github.com/PowerShell/PowerShell/releases/

Step 2: We downloaded the latest PowerShell installation package for Ubuntu 16.04 (powershell_6.0.0-alpha.18-1ubuntu1.16.04.1_amd64.deb). We then installed it, updated the apt-get index and installed the PowerShell dependencies by running these three commands:

dpkg -i powershell_6.0.0-alpha*deb

apt-get update

apt-get install –f

Installing and Using apt-get

Step 1: First, import the public repository GPG keys:

curl https://packages.microsoft.com/keys/microsoft.asc > MS.key

apt-key add MS.key

Step 2: Next, register Microsoft repository with apt:

curl https://packages.microsoft.com/config/ubuntu/16.04/prod.list | sudo tee /etc/apt/sources.list.d/microsoft.list

Step 3: Then update apt-get:

sudo apt-get update

Step 4: Finally, install PowerShell:

sudo apt-get install -y powershell

Final Words

We hope our article on how to Install PowerShell Core on Linux VM will help you and resolve all your problems. A virtual machine (VM) is a virtual environment that acts as a virtual computer operating system with its own CPU, memory, network interface, and storage, created on a physical hardware system (external or local). Software called a hypervisor separates the machine’s resources from the hardware and provisions them appropriately for the VM to use. If you want to know how to use PowerShell in Linux VM then follow the steps mentioned above.

I hope you understand this article, How to Use PowerShell Core on Linux Virtual Machines.

Editorial Staff
Editorial Staffhttps://www.bollyinside.com
The Bollyinside editorial staff is made up of tech experts with more than 10 years of experience Led by Sumit Chauhan. We started in 2014 and now Bollyinside is a leading tech resource, offering everything from product reviews and tech guides to marketing tips. Think of us as your go-to tech encyclopedia!

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Related Articles

Best Telemedicine Software: for your healthcare practice

Telemedicine software has transformed my healthcare visits. It's fantastic for patients and doctors since they can obtain aid quickly. I...
Read more
I love microlearning Platforms in today's fast-paced world. Short, focused teachings that engage me are key. Microlearning platforms are great...
Think of a notebook on your computer or tablet that can be changed to fit whatever you want to write...
As of late, Homeschool Apps has gained a lot of popularity, which means that an increasing number of...
From what I've seen, HelpDesk software is essential for modern businesses to run easily. It's especially useful for improving customer...
For all of our important pictures, stories, and drawings, Google Drive is like a big toy box. But sometimes the...