mono + pash : 在linux中运行PowerShell的解决方案

 

项目开发须要,须要调查在linux平台上面运行PowerShell的方法。linux

我再微软的官方博客中找到了PowerShell的linux平台解决方案(http://blogs.msdn.com/b/powershell/archive/2008/04/08/powershell-on-linux-solaris-mac-etc.aspxgit

主要实现技术是:mono + pash ,其中 github

mono:开源的跨平台.NET运行环境(http://www.mono-project.com/)shell

pash: 运行在mono环境的PowerShell开源实现方案(https://github.com/Pash-Project/Pash)session

 

一: 安装.NET运行环境 mono测试

下载地址见官网 (http://www.mono-project.com/) blog

1) 进入mono-4.2.1 的目录, 执行命令开发

   # ./autogenget

 

2) 获取并安装 monolite(包含运行mcs编译器的相关文件),执行下面命令须要当前linux系统可以用wget命令联网。编译器

# make get-monolite-latest

(注:若是没法联网,能够手动下载相应monolite-138-latest.tar.gz包   http://storage.bos.xamarin.com/mono-dist-master/latest/monolite-138-latest.tar.gz )


3 ) 执行make命令

# make

 

4

 

二: 安装pash

下载地址见官网 (https://github.com/Pash-Project/Pash)
1) 解压安装包,进行到 Pash-master 目录

  #cd Pash-master

2 ) 执行命令

 

可是,通过在SUSE Linux Enterprise Server 11环境上安装mono+pash进行测试发现。虽然能够执行大部分PowerShell命令,确并无彻底移植实现Windows平台上PowerShell的全部命令。

(见PowerShell的命令库 https://msdn.microsoft.com/en-us/library/powershell_mref_reference_home%28v=vs.85%29.aspx 和 Pash移植实现的命令库  https://github.com/Pash-Project/Pash/tree/master/Source)

诸如命令 new-pssession 、New-PSsessionOption和Invoke-command 命令等不在pash的命令库中。

相关文章
相关标签/搜索