微软刚刚开源了PowerShell,目前在Linux和MacOS上都能安装。具体的链接如下:

https://github.com/PowerShell/PowerShell

本文将介绍如何在CentOS 7.2下安装PowerShell。

首先在CentOS下下载PowerShell的安装包:

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
或者:
wget https://hweast.blob.core.chinacloudapi.cn/soft/powershell-6.0.0_alpha.9-1.el7.centos.x86_64.rpm

安装时报错:

rpm -ivh powershell-6.0.0_alpha.-.el7.centos.x86_64.rpm
warning: powershell-6.0.0_alpha.-.el7.centos.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID be1229cf: NOKEY
error: Failed dependencies:
    libunwind is needed by powershell-6.0.0_alpha.-.x86_64
    libicu is needed by powershell-6.0.0_alpha.-.x86_64

需要通过yum安装两个依赖包:

yum install -y libunwind libicu

安装完成后,再次运行rpm安装成功。

rpm -ivh powershell-6.0.0_alpha.-.el7.centos.x86_64.rpm
warning: powershell-6.0.0_alpha.-.el7.centos.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID be1229cf: NOKEY
Preparing... ################################# [%]
Updating / installing...
:powershell-6.0.0_alpha.- ################################# [%]

成功后,可以运行powershell启动powershell环境:

[root@hwslbvm02 ~]# powershell
PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.
 
PS /root> get-module
 
ModuleType Version Name ExportedCommands
---------- ------- ---- ----------------
Manifest 3.1.0.0 Microsoft.PowerShell.Utility {Add-Member, Add-Type, Clear-Variable, Compare-Object...}
Script 1.2 PSReadLine {Get-PSReadlineKeyHandler, Get-PSReadlineOption, Remove-PSReadlineKeyHandler, Set-PSReadlineKey...
 
PS /root> Get-PSRepository
 
Name InstallationPolicy SourceLocation
---- ------------------ --------------
PSGallery Untrusted https://www.powershellgallery.com/api/v2/

在CentOS上安装PowerShell的更多相关文章

  1. NoSql1 在Linux(CentOS)上安装memcached及使用

    前言:       今天是初五,生活基本要从过年的节奏中回归到正常的生活了,所以想想也该想想与工作有关的事情了.我之前在工作中会经常使用memcached和redis,但是自己一直没有时间系统的好好看 ...

  2. 在Ubuntu|CentOS上安装Shutter截图工具及快捷键设置

    简介 Shutter前身叫GScrot,它是一款相当棒的截图软件. 通过Shutter,你可以截取包括选定区域.全屏幕.窗口.窗口内的控件甚至网页的图像.通过内置的强大插件机制,你可以在截图后,对图像 ...

  3. 在CentOS上安装rabbitmq-server

    ***在 CentOS 6.4上安装python*** 注意啊,自己手动安装python2.7.5,不要动系统上面其他的版本 1,先安装GCC,用如下命令yum install gcc gcc-c++ ...

  4. CentOS上安装软件错误提示:configure: error: no acceptable C compiler found in $PATH

    CentOS上安装软件错误提示:configure: error: no acceptable C compiler found in $PATH 因为是centos linux,默认可以采用yum方 ...

  5. 如何在centos上安装epel源

    一.EPEL是什么? EPEL (Extra Packages for Enterprise Linux,企业版Linux的额外软件包) 是Fedora小组维护的一个软件仓库项目,为RHEL/Cent ...

  6. 在Centos上安装RabbitMQ流程(转)

    在Centos上安装RabbitMQ流程------------------------ 1. 需求 由于项目中要用到消息队列,经过ActiveMQ与RabbitMQ的比较,最终选择了RabbbitM ...

  7. 在CentOS上安装ZooKeeper集群

    一共准备3个CentOS虚拟机 172.16.9.194 172.16.9.195 172.16.9.196 上传zookeeper-3.3.6.tar.gz到服务器并解压,3台服务器的目录结构如下 ...

  8. CentOS上安装Node.js

    CentOS上安装Node.js [日期:2014-07-21] 来源:Linux社区  作者:maskdfe [字体:大 中 小]     CentOS上安装Node.js(想在Linux上学习No ...

  9. Linux系统入门学习:在CentOS上安装phpMyAdmin

    问题:我正在CentOS上运行一个MySQL/MariaDB服务,并且我想要通过网络接口来用phpMyAdmin来管理数据库.在CentOS上安装phpMyAdmin的最佳方法是什么? phpMyAd ...

随机推荐

  1. 摊铺机基本参数介绍(三一重工SSP220C-5)

    三一重工SSP220C-5稳定土摊铺机参数 SSP系列稳定土摊铺机SSP220C-5 动力强劲162kw 动力充分满足摊铺机各种工况下动力需求 高效任何工况,确保摊铺能力大于900t/h,行业内绝无仅 ...

  2. codeforces上某题

    一道codeforces上的题目. 题目大意: 定义有k个不同的字符的字符串为好字符串.现在给出一个字符串,求解对该字符串的每个前缀Si至少是多少个好字符串的连接,若不能由好字符串连接而成则输出-1. ...

  3. HDU 2603 二分匹配

    #include <queue>#include <vector>#include <cstdio>#include <cstring>#include ...

  4. Centos6.5安装php5.6.7

    1. 下载 官网:http://php.net/downloads.php wget http://cn2.php.net/get/php-5.6.7.tar.gz/from/this/mirror ...

  5. HBase学习3(win下使用Eclipse搭建hbase开发环境)

    第一步:创建一个java project命名为wujiadong_hbase 第二步:在该工程下创建一个folder命名为lib(储存依赖的jar包) 第三步:将集群中的hbase安装目录下载一份到w ...

  6. Kafka详解六:Kafka如何通过源码实现监控

    问题导读: 1.kafka的消费者组的消费偏移存储,kafka支持两个版本?        2.ConsumerOffsetChecker类的作用是什么?        3.Kafka如何通过源码实现 ...

  7. hdu 5877 Weak Pair dfs序+树状数组+离散化

    Weak Pair Time Limit: 4000/2000 MS (Java/Others)    Memory Limit: 262144/262144 K (Java/Others) Prob ...

  8. Python ssh 远程执行shell命令

    工具 python paramiko 远程执行命令 import paramiko ssh = paramiko.SSHClient() key = paramiko.AutoAddPolicy() ...

  9. SQL Server中的执行引擎入门

      简介 当查询优化器(Query Optimizer)将T-SQL语句解析后并从执行计划中选择最低消耗的执行计划后,具体的执行就会交由执行引擎(Execution Engine)来进行执行.本文旨在 ...

  10. JavaScriptSerializer 日期处理 JSON.Net

    [WebMethod(Description = "取得所有人员 自带json")] [SoapHeader("key")] [ScriptMethod(Res ...