Pash installation note-run the powershell script (*. PS1) in Linux)
Powershell in Linux PS1 in Linux Pash powershell missionary 2014-09-15
1 Overview
In short, Pash is Bash + powershell.
2 Official Website
Https://github.com/Pash-Project/Pash
3. Download fedora20 --- lxde desktop --- 32-bit edition.
Http://download.fedoraproject.org/pub/fedora/linux/releases/20/Live/i386/Fedora-Live-LXDE-i686-20-1.iso
4. Use the vmwarevm to install linux. Set the user root, password = 123456, user user001, password = 123456.
5. Install 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. Install git
yum install git
# Powershell missionary original articles may be reprinted on February 15, but the name and source must be retained; otherwise, legal liability shall be held accountable.
7. Compile and install Pash
cd /git clone https://github.com/Pash-Project/Pash.gitcd /Pash//opt/mono/bin/xbuild /Pash/Pash.proj
Run
/opt/mono/bin/mono /Pash/Source/PashConsole/bin/Debug/Pash.exe
8. In lxde desktop, the default Notepad program leafpad (the software name is leafpad, and leafpad is also typed in the command line) is used to create a test script in Linux. The save format is utf8, note the carriage return symbol.
------------------------
#!/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}
------------- Postscript = existing problems -----------
Else cannot start a row.
if ($aaa -eq 123){ write-host ‘bbb‘} else{ write-host ‘ccc‘}
Yes, but not below.
if ($aaa -eq 123){ write-host ‘bbb‘} else{ write-host ‘ccc‘}
--------------- Download in group -----------------
Note: The following downloading content has been completed. That is, you downloaded the file that I have installed.
# QQ group number = 183173532
# Name = powershell Contact Group
File size = 1 GB
Pash_in_linux_vmware _rar5. rar
Sha1 = 54277968fda57db8ce413e05914867f411c02fd7
Pash Installation notes