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

时间:2023-03-08 17:48:57

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

问:powershell二进制安装包,和.net core是什么关系?

答: powershell依赖.net。不论win还是linux,powershell都是.net的一个代码库分支。

问:什么是 .net core?

答: .net core是微软.net的跨平台版本。

问:.net core大致包含几个分支?

答: .net core中大致包含asp.net,powershell,f#。

问:.net core目前版本是多少?

答: .net core分为:

1.0 lts 老旧版。

1.1 稳定版。

2.0 当前版。

问:.net core目前支持哪些平台?

答:

请先围观这里:

https://github.com/dotnet/core-setup/blob/master/README.md

问:powershell二进制安装包,依赖哪些linux库?

答: libicu libunwind uuid

问:powershell二进制安装包,被装在哪里?

答:

/opt/microsoft/powershell/6.0.xxx版本号

然后在/usr/bin下,增加了个连接powershell

问:linux版powershell如何运行?

答:

在bash下,powershell回车。然后打查看版本命令:

$PSVersionTable #powershell命令不区分大小写

问:二进制powershell包,支持哪些系统?

答:

◦Ubuntu 14.04 , 16.04

◦CentOS , RHEL 7及以上

◦open SUSE 13及以上

◦Arch Linux (archl inux 没有版本号)

◦LINUX docker 容器

◦Linux AppImage 容器

问:powershell官网在哪里?

答:

https://github.com/PowerShell/PowerShell/releases

问:macOS 10及以上,二进制powershell安装包,如何安装?

答:

先去官网下载最新版二进制安装包,然后:

sudo installer -pkg powershell-6.0.0-alphaxxxxx.pkg -target /

问:二进制powershell安装包,如何下载?

答:

wget  https://github.com/PowerShell/PowerShell/releases/download/v6.0.0-xxxxxxxx.rpm

问:二进制powershell安装包,下载太慢怎么办?

答:

先安装aria2,安装后就有aria2c命令,用这个命令下载,即可随时中断,随时断点续传。如:

aria2c  https://github.com/PowerShell/PowerShell/releases/download/v6.0.0-xxxxxxxx.rpm

问:centos7,rhel7,二进制powershell安装包,如何安装?

答:

先去官网下载最新版二进制安装包,然后:

rpm -ivh ./powershell-6.0.0_xxxxxxx.rpm

问:centos7,rhel7,二进制powershell安装包,如何升级?

答:

1下载【新的版本.rpm】

2rpm -Uvh 新的版本.rpm

问:Ubuntu 14.04,Ubuntu 16.04,二进制powershell安装包,如何安装?

答:

先去官网下载最新版二进制安装包,然后:

sudo dpkg -i powershell_6.0.0-alpha.xxxxxxxx_amd64.deb sudo apt-get install -f

问:OpenSUSE 13及以上,二进制powershell安装包,如何安装?

答:

先去官网下载最新版二进制安装包,然后:

sudo zypper install ./powershell-6.0.0_xxxxxxx.rpm

问:Arch Linux,powershell安装包,如何安装?

答:

powershell源码已经进入arch linux 源码仓库。【Arch Linux User Repository (AUR)】 如需安装,请参考官方手册。 https://wiki.archlinux.org/index.php/Arch_User_Repository#Installing_packages

问:docker版的powershell,如何安装?

答:

http://www.cnblogs.com/piapia/p/5884838.html

问:docker版的powershell,有什么优点?

答:

1 下载速度比较快。

2 安装比较简单。

问:docker版的powershell,有什么缺点?

答:

容器把【宿主机子】,和【子容器】隔离了。 get-process查进程,查服务的,查端口的【子容器命令】,都无法访问【宿主机子】,或者设置成可访问,比较麻烦。

问:神马是“Linux AppImage”?

答: “Linux AppImage” 是一个linux软件,这个软件自带一个仓库。仓库中的都是绿色的软件,这些软件无需安装,下载后,即可运行。 这个软件类似于docker,即以linux服务的形式运行后,仓库中的绿色软件通过这个服务运行。

问:“Linux AppImage”官网在哪?

答:

https://github.com/probonopd/AppImageKit

问:如何把“Linux AppImage”安装成服务?

答:

wget  https://github.com/probonopd/AppImageKit/releases/download/continuous/appimaged-x86_64.AppImage

chmod a+x ./appimaged-x86_64.AppImage

./appimaged-x86_64.AppImage -i  #root权限

问:“Linux AppImage”服务,已经运行,如何运行powershell绿色版?

答:

先去官网下载最新版二进制包,然后:

chmod a+x PowerShell-x86_64.AppImage ./PowerShell-x86_64.AppImage     #支持在终端中运行此命令

问:“Linux AppImage”版powershell绿色版,有什么缺点?

答: 目前下载比较慢。

问:“Linux AppImage”版powershell绿色版,有什么优点?

答: 相对docker版,有优势。可以访问本地磁盘,可以访问本地进程等。

===========================完=============================