lastcoolnameleft
5/25/2017 - 7:48 PM

Powershell on Centos

Powershell on Centos

➜  service-fabric-linux-vagrant-onebox git:(master) ✗ docker run -it centos bash
[root@d0a449b03a5e /]# wget https://github.com/PowerShell/PowerShell/releases/download/v6.0.0-alpha.15/powershell-6.0.0_alpha.15-1.el7.centos.x86_64.rpm
bash: wget: command not found
[root@d0a449b03a5e /]# apt-get install wget
bash: apt-get: command not found
[root@d0a449b03a5e /]# apt-get install wget^C
[root@d0a449b03a5e /]# yum install wget
Loaded plugins: fastestmirror, ovl
base                                                                                                                                                                                                                  | 3.6 kB  00:00:00
extras                                                                                                                                                                                                                | 3.4 kB  00:00:00
updates                                                                                                                                                                                                               | 3.4 kB  00:00:00
(1/4): extras/7/x86_64/primary_db                                                                                                                                                                                     | 151 kB  00:00:00
(2/4): base/7/x86_64/group_gz                                                                                                                                                                                         | 155 kB  00:00:00
(3/4): base/7/x86_64/primary_db                                                                                                                                                                                       | 5.6 MB  00:00:01
(4/4): updates/7/x86_64/primary_db                                                                                                                                                                                    | 4.9 MB  00:00:02
Determining fastest mirrors
 * base: pubmirrors.dal.corespace.com
 * extras: mirror.team-cymru.org
 * updates: dist1.800hosting.com
Resolving Dependencies
--> Running transaction check
---> Package wget.x86_64 0:1.14-13.el7 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

=============================================================================================================================================================================================================================================
 Package                                                Arch                                                     Version                                                        Repository                                              Size
=============================================================================================================================================================================================================================================
Installing:
 wget                                                   x86_64                                                   1.14-13.el7                                                    base                                                   546 k

Transaction Summary
=============================================================================================================================================================================================================================================
Install  1 Package

Total download size: 546 k
Installed size: 2.0 M
Is this ok [y/d/N]: y
Downloading packages:
warning: /var/cache/yum/x86_64/7/base/packages/wget-1.14-13.el7.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID f4a80eb5: NOKEY
Public key for wget-1.14-13.el7.x86_64.rpm is not installed
wget-1.14-13.el7.x86_64.rpm                                                                                                                                                                                           | 546 kB  00:00:00
Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
Importing GPG key 0xF4A80EB5:
 Userid     : "CentOS-7 Key (CentOS 7 Official Signing Key) <security@centos.org>"
 Fingerprint: 6341 ab27 53d7 8a78 a7c2 7bb1 24c6 a8a7 f4a8 0eb5
 Package    : centos-release-7-3.1611.el7.centos.x86_64 (@CentOS)
 From       : /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
Is this ok [y/N]: y
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : wget-1.14-13.el7.x86_64                                                                                                                                                                                                   1/1
install-info: No such file or directory for /usr/share/info/wget.info.gz
  Verifying  : wget-1.14-13.el7.x86_64                                                                                                                                                                                                   1/1

Installed:
  wget.x86_64 0:1.14-13.el7

Complete!
[root@d0a449b03a5e /]# wget https://github.com/PowerShell/PowerShell/releases/download/v6.0.0-alpha.15/powershell-6.0.0_alpha.15-1.el7.centos.x86_64.rpm
--2017-05-25 19:45:31--  https://github.com/PowerShell/PowerShell/releases/download/v6.0.0-alpha.15/powershell-6.0.0_alpha.15-1.el7.centos.x86_64.rpm
Resolving github.com (github.com)... 192.30.253.113, 192.30.253.112
Connecting to github.com (github.com)|192.30.253.113|:443... connected.
HTTP request sent, awaiting response... 302 Found
Location: https://github-production-release-asset-2e65be.s3.amazonaws.com/49609581/48141396-e1a3-11e6-9d5c-5dadbf1e2899?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20170525%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20170525T194532Z&X-Amz-Expires=300&X-Amz-Signature=9350f284b31f0af6897c6a3213b92fd3ac0055ffa2ae6eea2d9d95b8ff8ed8e4&X-Amz-SignedHeaders=host&actor_id=0&response-content-disposition=attachment%3B%20filename%3Dpowershell-6.0.0_alpha.15-1.el7.centos.x86_64.rpm&response-content-type=application%2Foctet-stream [following]
--2017-05-25 19:45:31--  https://github-production-release-asset-2e65be.s3.amazonaws.com/49609581/48141396-e1a3-11e6-9d5c-5dadbf1e2899?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20170525%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20170525T194532Z&X-Amz-Expires=300&X-Amz-Signature=9350f284b31f0af6897c6a3213b92fd3ac0055ffa2ae6eea2d9d95b8ff8ed8e4&X-Amz-SignedHeaders=host&actor_id=0&response-content-disposition=attachment%3B%20filename%3Dpowershell-6.0.0_alpha.15-1.el7.centos.x86_64.rpm&response-content-type=application%2Foctet-stream
Resolving github-production-release-asset-2e65be.s3.amazonaws.com (github-production-release-asset-2e65be.s3.amazonaws.com)... 54.231.114.187
Connecting to github-production-release-asset-2e65be.s3.amazonaws.com (github-production-release-asset-2e65be.s3.amazonaws.com)|54.231.114.187|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 41255839 (39M) [application/octet-stream]
Saving to: 'powershell-6.0.0_alpha.15-1.el7.centos.x86_64.rpm'

100%[===================================================================================================================================================================================================>] 41,255,839  5.80MB/s   in 6.8s

2017-05-25 19:45:38 (5.77 MB/s) - 'powershell-6.0.0_alpha.15-1.el7.centos.x86_64.rpm' saved [41255839/41255839]

[root@d0a449b03a5e /]# sudo yum install -y powershell-6.0.0_alpha.15-1.el7.centos.x86_64.rpm
bash: sudo: command not found
[root@d0a449b03a5e /]# yum install -y powershell-6.0.0_alpha.15-1.el7.centos.x86_64.rpm
Loaded plugins: fastestmirror, ovl
Examining powershell-6.0.0_alpha.15-1.el7.centos.x86_64.rpm: powershell-6.0.0_alpha.15-1.el7.centos.x86_64
Marking powershell-6.0.0_alpha.15-1.el7.centos.x86_64.rpm to be installed
Resolving Dependencies
--> Running transaction check
---> Package powershell.x86_64 0:6.0.0_alpha.15-1.el7.centos will be installed
--> Processing Dependency: libicu for package: powershell-6.0.0_alpha.15-1.el7.centos.x86_64
Loading mirror speeds from cached hostfile
 * base: pubmirrors.dal.corespace.com
 * extras: mirror.team-cymru.org
 * updates: dist1.800hosting.com
--> Processing Dependency: openssl for package: powershell-6.0.0_alpha.15-1.el7.centos.x86_64
--> Processing Dependency: libunwind for package: powershell-6.0.0_alpha.15-1.el7.centos.x86_64
--> Processing Dependency: uuid for package: powershell-6.0.0_alpha.15-1.el7.centos.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
---> Package openssl.x86_64 1:1.0.1e-60.el7_3.1 will be installed
--> Processing Dependency: make for package: 1:openssl-1.0.1e-60.el7_3.1.x86_64
---> Package uuid.x86_64 0:1.6.2-26.el7 will be installed
--> Running transaction check
---> Package make.x86_64 1:3.82-23.el7 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

=============================================================================================================================================================================================================================================
 Package                                      Arch                                     Version                                                        Repository                                                                        Size
=============================================================================================================================================================================================================================================
Installing:
 powershell                                   x86_64                                   6.0.0_alpha.15-1.el7.centos                                    /powershell-6.0.0_alpha.15-1.el7.centos.x86_64                                   124 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                                                base                                                                              56 k
 make                                         x86_64                                   1:3.82-23.el7                                                  base                                                                             420 k
 openssl                                      x86_64                                   1:1.0.1e-60.el7_3.1                                            updates                                                                          713 k
 uuid                                         x86_64                                   1.6.2-26.el7                                                   base                                                                              55 k

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

Total size: 132 M
Total download size: 8.1 M
Installed size: 151 M
Downloading packages:
(1/5): libunwind-1.1-5.el7_2.2.x86_64.rpm                                                                                                                                                                             |  56 kB  00:00:00
(2/5): make-3.82-23.el7.x86_64.rpm                                                                                                                                                                                    | 420 kB  00:00:00
(3/5): uuid-1.6.2-26.el7.x86_64.rpm                                                                                                                                                                                   |  55 kB  00:00:00
(4/5): openssl-1.0.1e-60.el7_3.1.x86_64.rpm                                                                                                                                                                           | 713 kB  00:00:01
(5/5): libicu-50.1.2-15.el7.x86_64.rpm                                                                                                                                                                                | 6.9 MB  00:00:01
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                                                                                                                        5.2 MB/s | 8.1 MB  00:00:01
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : 2:libunwind-1.1-5.el7_2.2.x86_64                                                                                                                                                                                          1/6
  Installing : 1:make-3.82-23.el7.x86_64                                                                                                                                                                                                 2/6
  Installing : 1:openssl-1.0.1e-60.el7_3.1.x86_64                                                                                                                                                                                        3/6
  Installing : uuid-1.6.2-26.el7.x86_64                                                                                                                                                                                                  4/6
  Installing : libicu-50.1.2-15.el7.x86_64                                                                                                                                                                                               5/6
  Installing : powershell-6.0.0_alpha.15-1.el7.centos.x86_64                                                                                                                                                                             6/6
  Verifying  : 1:openssl-1.0.1e-60.el7_3.1.x86_64                                                                                                                                                                                        1/6
  Verifying  : libicu-50.1.2-15.el7.x86_64                                                                                                                                                                                               2/6
  Verifying  : uuid-1.6.2-26.el7.x86_64                                                                                                                                                                                                  3/6
  Verifying  : powershell-6.0.0_alpha.15-1.el7.centos.x86_64                                                                                                                                                                             4/6
  Verifying  : 1:make-3.82-23.el7.x86_64                                                                                                                                                                                                 5/6
  Verifying  : 2:libunwind-1.1-5.el7_2.2.x86_64                                                                                                                                                                                          6/6

Installed:
  powershell.x86_64 0:6.0.0_alpha.15-1.el7.centos

Dependency Installed:
  libicu.x86_64 0:50.1.2-15.el7                  libunwind.x86_64 2:1.1-5.el7_2.2                  make.x86_64 1:3.82-23.el7                  openssl.x86_64 1:1.0.1e-60.el7_3.1                  uuid.x86_64 0:1.6.2-26.el7

Complete!
[root@d0a449b03a5e /]# power
poweroff    powershell
[root@d0a449b03a5e /]# powershell
PowerShell
Copyright (C) 2016 Microsoft Corporation. All rights reserved.

PS /> asdfasdf
asdfasdf : The term 'asdfasdf' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1
+ asdfasdf
+ ~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (asdfasdf:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

PS />