首页 > 代码库 > pash 安装手记

pash 安装手记

pash 安装手记---在linux中运行powershell脚本(*.ps1)

powershell in linux  ps1 in linux  pash powershell 传教士 2014-09-15

1简介

简单来说pash就是bash+powershell

 

2官网

https://github.com/Pash-Project/Pash

 

3下载fedora20---lxde桌面---32位版。

http://download.fedoraproject.org/pub/fedora/linux/releases/20/Live/i386/Fedora-Live-LXDE-i686-20-1.iso

 

4用vmware虚拟机安装linux,设置用户root,密码=123456,用户user001,密码=123456

 

5安装mono

yum install wgetcd /etc/yum.repos.d/wget http://download.opensuse.org/repositories/home:tpokorra:mono/Fedora_20/home:tpokorra:mono.repoyum install mono-opt

 

 

6安装git

yum install git

 

#powershell 传教士 原创文章 2014-09-15 允许转载,但必须保留名字和出处,否则追究法律责任

 

7编译安装pash

cd /git  clone  https://github.com/Pash-Project/Pash.gitcd /Pash//opt/mono/bin/xbuild    /Pash/Pash.proj

 

 

运行

/opt/mono/bin/mono     /Pash/Source/PashConsole/bin/Debug/Pash.exe

 

 

8用lxde桌面中,默认的记事本程序leafpad,(软件名叫leafpad,在命令行中也是敲leafpad)在linux中建立测试脚本,保存格式为utf8,注意回车符号。

------------------------

#!/opt/mono/bin/mono     /Pash/Source/PashConsole/bin/Debug/Pash.exe# test.ps1write-host ‘aaaa‘ 

1..6$aaa=123if ($aaa -eq 123){  write-host ‘bbb‘} else{  write-host ‘ccc‘}for ($i=1;$i -lt 5;$i++){  write-host ‘ddd‘,$i} $eee=1..8foreach ($temp in $eee){  write-host ‘eee‘,$temp}

 

-------------后记=目前存在的问题-----------

else不能在行首。

if ($aaa -eq 123){    write-host ‘bbb‘} else{    write-host ‘ccc‘}

 

上面可以,下面不行

if ($aaa -eq 123){    write-host ‘bbb‘} else{    write-host ‘ccc‘}

 

---------------群内下载-----------------

注意:下述下载内容,已经经过了上述步骤。即,你下载的是我已经安装好的了。

#QQ群号=183173532

#名称=powershell交流群

文件大小=1GB

pash_in_linux_vmware虚拟机_rar5版以上才能解压.rar

SHA1=54277968FDA57DB8CE413E05914867F411C02FD7

 

pash 安装手记