linux 安装 powershell

Intro

powershell 已经推出了一个 Powershell Core, 版本号对应 Powershell 6.x,可以跨平台,支持 Linux 和 mac.

这使得对于熟练使用 Powershell 进行开发运维的一些开发者来说无疑是个福音。

今天就来在 Linux 上安装 powershell,以 centos7 为例介绍安装 powershell。

PowerShell 和 PowerShell Core

那Windows PowerShell与PowerShell Core 6.0又有什么区别呢,主要几个区别如下:

  • Windows PowerShell是基于.NET Framework的,所以它也只能在Windows中使用。

    PowerShell Core 6.0发布时,Windows PowerShell 最新的版本在5.*,但PowerShell Core 6.0 可不是Windows PowerShell的升级版本。
  • PowerShell Core 6.0因为它的跨平台,自然不仅可以在 Windows 上运行也可以在其它平台如macOS与Linux上运行,因为它是基于.NET Core基础之上的。
  • Windows PowerShell在 Windows 中的执行文件为powershell.exe,而PowerShell Core 6.0在Windows中的执行文件是pwsh.exe,在 macOS 和 Linux 中的执行文件是 pwsh

PowerShell Core 平台支持情况

PowerShell 现在官方支持 macOS 和 Linux,包括:

  • Windows 7、8.1 和 10
  • Windows Server 2008 R2、2012 R2、2016
  • Windows Server 半年频道
  • Ubuntu 14.04、16.04 和 17.04
  • Debian 8.7+ 和 9
  • CentOS 7
  • Red Hat Enterprise Linux 7
  • OpenSUSE 42.2
  • Fedora 25、26
  • macOS 10.12+

我们社区也为以下平台提供包,但是它们不受正式支持:

  • Arch Linux
  • Kali Linux
  • AppImage(可在多个 Linux 平台上运行)

我们还对以下平台提供试验版本(不受支持):

  • ARM32/ARM64 上的 Windows
  • Raspbian (Stretch)

在 Linux上安装 PowerShell

这里以 Centos 为例,介绍如何安装 PowerShell,其他 Linux 系统可以参考这里的文档

这里有两种方式可以安装

  • 注册微软的镜像源(推荐)

    # Register the Microsoft RedHat repository
    curl https://packages.microsoft.com/config/rhel/7/prod.repo | sudo tee /etc/yum.repos.d/microsoft.repo # Install PowerShell
    sudo yum install -y powershell
  • 直接下载文件安装

    sudo yum install https://github.com/PowerShell/PowerShell/releases/download/v6.1.0/powershell-6.1.0-1.rhel.7.x86_64.rpm

安装完成之后可以直接执行 pwsh 就可以进入 powershell 了,如果可以正常进入则证明安装成功了。

卸载

sudo yum remove powershell

Reference

Contact

Contact me: weihanli@outlook.com

Linux 安装 powershell的更多相关文章

  1. linux版powershell安装教程(.net core版)

    powershell 传教士 原创文章 始于2016-12-20,2017-03-15改.文章版本目前博客园为最新版. 允许转载,但必须保留名字和出处,否则追究法律责任 问:powershell二进制 ...

  2. CentOS 7 上面安装PowerShell

    看了文章 爱上PowerShell , 就想在CentOS 7上面试试PowerShell , 本文记录了在CentOS 7.2上安装Powershell 的过程. 首先我们要从github上下载最新 ...

  3. 巧用linux版powershell,管理linux下的docker

    大家好,我把用powershell的docker马甲命令的好处,放在了页面下方,从第五章开始. powershell 传教士 原创文章 始于 2017-09-07 允许转载,但必须保留名字和出处,否则 ...

  4. 在CentOS上安装PowerShell

    微软刚刚开源了PowerShell,目前在Linux和MacOS上都能安装.具体的链接如下: https://github.com/PowerShell/PowerShell 本文将介绍如何在Cent ...

  5. 搜狗输入法linux安装 以及 12个依赖包下载链接分享

    搜狗输入法linux安装版,先安装各种依赖包,大概12个依赖,可能中途还需要其他依赖,可以效仿解决依赖问题.如图这12个文件要是手动点击下载,那也太笨点了,我们要用shell命令批量下载.命令如下:w ...

  6. linux安装php

    接上篇:linux安装apache 一.安装php 先安装libxml2库 [root@ctxsdhy package]# yum -y install libxml2-devel 最新地址在:htt ...

  7. linux安装oracle11g

    准备oracle安装文件 Oracle11gR2包含两个文件linux_11gR2_database_1of2.zip和linux_11gR2_database_2of2.zip,将这两个文件通过SS ...

  8. TODO:Linux安装PHP MongoDB驱动

    TODO:Linux安装PHP MongoDB驱动 PHP利于学习,使用广泛,主要适用于Web开发领域. MongoDB的主要目标是在键/值存储方式(提供了高性能和高度伸缩性)以及传统的RDBMS系统 ...

  9. Symantec Backup Exec 2010 Agent For Linux安装

    以前写过一篇文章介绍过Symantec Backup Exec 2012 Agent For Linux安装安装,今天介绍一下Symantec Backup Exec 2010 Agent For L ...

随机推荐

  1. Python学习笔记【Supervisor】:使用Supervisor监控Tornado进程

    Linux常见应用服务配置模式nginx和supervisor:采用主配置文件+项目配置文件 安装(如果使用pip安装注意看是否需要指定使用python2版本) 第一步:在Linux中使用apt-ge ...

  2. [Swift]LeetCode30. 与所有单词相关联的字串 | Substring with Concatenation of All Words

    You are given a string, s, and a list of words, words, that are all of the same length. Find all sta ...

  3. [Swift]LeetCode509. 斐波那契数 | Fibonacci Number

    The Fibonacci numbers, commonly denoted F(n) form a sequence, called the Fibonacci sequence, such th ...

  4. [Swift]LeetCode749. 隔离病毒 | Contain Virus

    A virus is spreading rapidly, and your task is to quarantine the infected area by installing walls. ...

  5. [Swift]LeetCode910. 最小差值 II | Smallest Range II

    Given an array A of integers, for each integer A[i] we need to choose either x = -K or x = K, and ad ...

  6. 『Tarjan算法 无向图的双联通分量』

    无向图的双连通分量 定义:若一张无向连通图不存在割点,则称它为"点双连通图".若一张无向连通图不存在割边,则称它为"边双连通图". 无向图图的极大点双连通子图被 ...

  7. Elasticsearch索引原理

    转载 http://blog.csdn.net/endlu/article/details/51720299 最近在参与一个基于Elasticsearch作为底层数据框架提供大数据量(亿级)的实时统计 ...

  8. ubuntu16.04 Golang语言开发环境搭建

    golang即go语言是跨平台的语言,适用于windows 和linux平台,下面介绍linux平台下ubuntu16.04系统下的开发环境搭建过程. 一.安装开发必备环境 执行下面命令分别安装git ...

  9. 从零开始学习PYTHON3讲义(八)列表类型跟冒泡排序

    <从零开始PYTHON3>第八讲 ​前面我们见过了不少的小程序,也见过了不少不同类型的变量使用的方法.但目前我们涉及到的,还都是单个的变量和单个的立即数.以变量来说,目前我们见到的,基本都 ...

  10. Kafka控制器选举流程剖析

    1.概述 平时在使用Kafka的时候,可能关注的更多的是Kafka系统层面的.今天来给大家剖析一下Kafka的控制器,了解一下Kafka控制器的选举流程. 2.内容 Kafka控制器,其实就是一个Ka ...