微软刚刚开源了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. eclipse修改项目默认编码为UTF-8

    1.windows->Preferences...打开"首选项"对话框,左侧导航树,导航到general->Workspace,右侧 Text file encodin ...

  2. 20145230《Java程序设计》第3周学习总结

    20145230 <Java程序设计> 第3周学习总结 教材学习内容总结 String s=new String();第四章我首先了解了CPU与内存的关系,栈与堆的关系.要产生对象必须先定 ...

  3. React Native的导入导出

    1.组件的导入导出方式 问1:如何导出一个组件? export default class EIComponent extends Component{ render(){ return( <T ...

  4. INSPIRED启示录 读书笔记 - 第40章 最佳实践经验

    十大要点 1.产品管理的职责:许多产品经理将大把的时间浪费在与产品管理无关的工作上 2.用户体验:对于大多数软件产品来说,用户体验就是产品的生命 3.机会评估:用方便快捷的机会评估方法取代过时的市场需 ...

  5. Linux操作系统的安装以及基本的操作命令详解

    背景:使用的虚拟机安装Linux  虚拟机使用的是VMware  Linux版本:CentOS-6.7-X86    自行下载:CentOS-6.7-x86_64-bin-DVD1.iso 打开VMw ...

  6. Spring Cloud Stream消息总线

    Springcloud 里面对于MQ的整合一个是前一篇的消息总线一个是本文介绍的消息驱动 大体要学习这么几个知识点: 课题:SpringCloud消息驱动Stream1.什么是SpringCloud消 ...

  7. OpenStack with Opendaylight Part 1: Intro to Pipeline

    Using Vagrant to create vm nodes; devstack to start openstack using Opendaylight as ML2. Openstack w ...

  8. Linux系统用户/用户组/文件权限相关

    目录一.Linux系统用户/用户组权限相关二.Linux系统文件权限相关 一.Linux系统用户/用户组权限相关 .命令:usermod 用法:usermod [-agGus] user args ‘ ...

  9. review39

    不可以在非同步方法中使用wait().notify()和notifyAll().

  10. review35

    使用Thread创建线程通常使用的方法是:Thread(Runnable target).该构造方法中的参数是一个Runnable类型的接口,因此在创建线程对象时必须向构造方法的参数传递一个实现Run ...