PowerShell 6.0.0 on CentOS 7

On August 18th Microsoft released the open source Powershell on Ubuntu 14.04/16.04, CentOS 7.1, and Mac OS X 10.11microsoft-powershell-open-source

Some nice links about the release:

https://channel9.msdn.com/Blogs/hybrid-it-management/PowerShell-on-Linux-and-Open-Source

https://azure.microsoft.com/en-us/blog/powershell-is-open-sourced-and-is-available-on-linux/

That is really good news because I’m working on a project to integrate more and more PowerShell monitoring plugins in NAGIOS. More on this topic later on.

But now get the Powershell installed on a CentOS 7

Login to the system 

# wget https://github.com/PowerShell/PowerShell/releases/download/v6.0.0-alpha.9/powershell-6.0.0_alpha.9-1.el7.centos.x86_64.rpm
--2016-09-07 00:00:56-- https://github.com/PowerShell/PowerShell/releases/download/v6.0.0-alpha.9/powershell-6.0.0_alpha.9-1.el7.centos.x86_64.rpm
Resolving github.com (github.com)... 192.30.253.112
Connecting to github.com (github.com)|192.30.253.112|:443... connected.
HTTP request sent, awaiting response... 302 Found
Location: https://github-cloud.s3.amazonaws.com/releases/49609581/814056d6-63b1-11e6-88ae-9550068bd70f.rpm?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAISTNZFOVBIJMK3TQ%2F20160906%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20160906T220056Z&X-Amz-Expires=300&X-Amz-Signature=1bfd089244f8e46460d66269ee0d61ef56b060ed3d9c3ca1f3cbce062e067941&X-Amz-SignedHeaders=host&actor_id=0&response-content-disposition=attachment%3B%20filename%3Dpowershell-6.0.0_alpha.9-1.el7.centos.x86_64.rpm&response-content-type=application%2Foctet-stream [following]
--2016-09-07 00:00:56-- https://github-cloud.s3.amazonaws.com/releases/49609581/814056d6-63b1-11e6-88ae-9550068bd70f.rpm?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAISTNZFOVBIJMK3TQ%2F20160906%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20160906T220056Z&X-Amz-Expires=300&X-Amz-Signature=1bfd089244f8e46460d66269ee0d61ef56b060ed3d9c3ca1f3cbce062e067941&X-Amz-SignedHeaders=host&actor_id=0&response-content-disposition=attachment%3B%20filename%3Dpowershell-6.0.0_alpha.9-1.el7.centos.x86_64.rpm&response-content-type=application%2Foctet-stream
Resolving github-cloud.s3.amazonaws.com (github-cloud.s3.amazonaws.com)... 52.216.1.176
Connecting to github-cloud.s3.amazonaws.com (github-cloud.s3.amazonaws.com)|52.216.1.176|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 40391065 (39M) [application/octet-stream]
Saving to: ‘powershell-6.0.0_alpha.9-1.el7.centos.x86_64.rpm’

100%[==========================================================================================================================================================================================>] 40,391,065 8.96MB/s in 6.3s

2016-09-07 00:01:03 (6.12 MB/s) - ‘powershell-6.0.0_alpha.9-1.el7.centos.x86_64.rpm’ saved [40391065/40391065]


Ready to install the package.

yum install powershell-6.0.0_alpha.9-1.el7.centos.x86_64.rp m
Loaded plugins: fastestmirror
Examining powershell-6.0.0_alpha.9-1.el7.centos.x86_64.rpm: 
powershell-6.0.0_alp ha.9-1.x86_64
Marking powershell-6.0.0_alpha.9-1.el7.centos.x86_64.rpm to be installed
Resolving Dependencies
--> Running transaction check
---> Package powershell.x86_64 0:6.0.0_alpha.9-1 will be installed
--> Processing Dependency: libunwind for package: 
powershell-6.0.0_alpha.9-1.x86 _64
Loading mirror speeds from cached hostfile
 * base: centos.mirrors.as250.net
 * epel: ftp.crc.dk
 * extras: centos.bio.lmu.de
 * updates: mirror.cj2.nl
--> Processing Dependency: libicu for package: powershell-6.0.0_alpha.9-1.x86_64
--> Running transaction check
---> Package libicu.x86_64 0:50.1.2-15.el7 will be installed
---> Package libunwind.x86_64 2:1.1-5.el7_2.2 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================
 Package Arch Version Repository Size
================================================================================
Installing:
 powershell x86_64 6.0.0_alpha.9-1 /powershell-6.0.0_alpha.9-1.el7.centos.x86_64
 121 M
Installing for dependencies:
 libicu x86_64 50.1.2-15.el7 base 6.9 M
 libunwind x86_64 2:1.1-5.el7_2.2 updates 56 k

Transaction Summary
================================================================================
Install 1 Package (+2 Dependent packages)

Total size: 128 M
Total download size: 6.9 M
Installed size: 145 M
Is this ok [y/d/N]: y

Downloading packages:
(1/2): libunwind-1.1-5.el7_2.2.x86_64.rpm | 56 kB 00:00:00
(2/2): libicu-50.1.2-15.el7.x86_64.rpm | 6.9 MB 00:00:02
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total 3.2 MB/s | 6.9 MB 00:00:02
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
 Installing : 2:libunwind-1.1-5.el7_2.2.x86_64 1/3
 Installing : libicu-50.1.2-15.el7.x86_64 2/3
 Installing : powershell-6.0.0_alpha.9-1.x86_64 3/3
 Verifying : powershell-6.0.0_alpha.9-1.x86_64 1/3
 Verifying : libicu-50.1.2-15.el7.x86_64 2/3
 Verifying : 2:libunwind-1.1-5.el7_2.2.x86_64 3/3

Installed:
 powershell.x86_64 0:6.0.0_alpha.9-1

Dependency Installed:
 libicu.x86_64 0:50.1.2-15.el7 libunwind.x86_64 2:1.1-5.el7_2.2

Complete!

Installation completed.

Let’s start

# powershell
PowerShell
Copyright (C) 2016 Microsoft Corporation. All rights reserved.

PS /tmp>

Great.

 

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s