Linux 安装 powershell
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
- https://docs.microsoft.com/zh-cn/powershell/scripting/whats-new/what-s-new-in-powershell-core-60?view=powershell-6
- https://docs.microsoft.com/zh-cn/powershell/scripting/setup/installing-powershell-core-on-linux?view=powershell-6#centos-7
Contact
Contact me: weihanli@outlook.com
Linux 安装 powershell的更多相关文章
- linux版powershell安装教程(.net core版)
powershell 传教士 原创文章 始于2016-12-20,2017-03-15改.文章版本目前博客园为最新版. 允许转载,但必须保留名字和出处,否则追究法律责任 问:powershell二进制 ...
- CentOS 7 上面安装PowerShell
看了文章 爱上PowerShell , 就想在CentOS 7上面试试PowerShell , 本文记录了在CentOS 7.2上安装Powershell 的过程. 首先我们要从github上下载最新 ...
- 巧用linux版powershell,管理linux下的docker
大家好,我把用powershell的docker马甲命令的好处,放在了页面下方,从第五章开始. powershell 传教士 原创文章 始于 2017-09-07 允许转载,但必须保留名字和出处,否则 ...
- 在CentOS上安装PowerShell
微软刚刚开源了PowerShell,目前在Linux和MacOS上都能安装.具体的链接如下: https://github.com/PowerShell/PowerShell 本文将介绍如何在Cent ...
- 搜狗输入法linux安装 以及 12个依赖包下载链接分享
搜狗输入法linux安装版,先安装各种依赖包,大概12个依赖,可能中途还需要其他依赖,可以效仿解决依赖问题.如图这12个文件要是手动点击下载,那也太笨点了,我们要用shell命令批量下载.命令如下:w ...
- linux安装php
接上篇:linux安装apache 一.安装php 先安装libxml2库 [root@ctxsdhy package]# yum -y install libxml2-devel 最新地址在:htt ...
- linux安装oracle11g
准备oracle安装文件 Oracle11gR2包含两个文件linux_11gR2_database_1of2.zip和linux_11gR2_database_2of2.zip,将这两个文件通过SS ...
- TODO:Linux安装PHP MongoDB驱动
TODO:Linux安装PHP MongoDB驱动 PHP利于学习,使用广泛,主要适用于Web开发领域. MongoDB的主要目标是在键/值存储方式(提供了高性能和高度伸缩性)以及传统的RDBMS系统 ...
- Symantec Backup Exec 2010 Agent For Linux安装
以前写过一篇文章介绍过Symantec Backup Exec 2012 Agent For Linux安装安装,今天介绍一下Symantec Backup Exec 2010 Agent For L ...
随机推荐
- github pages + Hexo + node.js 搭建属于自己的个人博客网站
之前我写过一篇用Github实现个人主页的博客:https://www.cnblogs.com/tu-0718/p/8081288.html 后来看到某个大佬写的文章:[5分钟 0元搭建个人独立 ...
- [SQL]LeetCode176. 第二高的薪水 | Second Highest Salary
Write a SQL query to get the second highest salary from the Employee table. +----+--------+ | Id | S ...
- [Swift]LeetCode685. 冗余连接 II | Redundant Connection II
In this problem, a rooted tree is a directed graph such that, there is exactly one node (the root) f ...
- nginx系列 3 nginx.conf介绍(1)
一. nginx.conf 文件结构概述 在第一篇中讲到nginx的安装,安装完后,默认的nginx服务器配置文件都存在安装目录conf中,主配置文件名为nginx.conf.下面是我linux系统安 ...
- Latex文件分别用Texwork和Winedt打开时,产生中文乱码的解决方法
中文兼容方法(能保证编译成功) \usepackage{CJK} \begin{document} \begin{CJK}{GBK}{kai} ... 中文 ... \end{CJK} \end{do ...
- Error: Cannot fit requested classes in a single dex file (# methods: 149346 > 65536)
引用第三方库的jar文件,都有可能会触发这个错误.解决方案如下: 参考<[Android]Cannot fit requested classes in a single dex file. T ...
- 剖析HBase负载均衡和性能指标
1.概述 在分布式系统中,负载均衡是一个非常重要的功能,在HBase中通过Region的数量来实现负载均衡,HBase中可以通过hbase.master.loadbalancer.class来实现自定 ...
- [一]class 文件浅析 .class文件格式详解 字段方法属性常量池字段 class文件属性表 数据类型 数据结构
前言概述 本文旨在讲解class文件的整体结构信息,阅读本文后应该可以完整的了解class文件的格式以及各个部分的逻辑组成含义 class文件包含了java虚拟机指令集 和 符号表 以及若 ...
- 学习编写Dockerfile
前言 我们学习docker的话,其主要目的还是要用来改变我们部署应用程序的传统习惯,达到解放生产力,解放人力的目的.这篇则自己来熟悉一下dockerfile常用命令.并且尝试改变下生产环境手动部署应用 ...
- javascript基础修炼(9)——MVVM中双向数据绑定的基本原理
开发者的javascript造诣取决于对[动态]和[异步]这两个词的理解水平. 一. 概述 1.1 MVVM模型 MVVM模型是前端单页面应用中非常重要的模型之一,也是Single Page Appl ...