toadloading

PowerShell 跨平台开源了

  •  
  •   toadloading · Aug 19, 2016 · 3425 views
    This topic created in 3560 days ago, the information mentioned may be changed or developed.
    PowerShell 团队发表的博客文章在这里:
    https://blogs.msdn.microsoft.com/powershell/2016/08/18/powershell-on-linux-and-open-source-2/

    文章里说:“ Alpha 版的 PowerShell 可以在 Ubuntu 14.04/16.04, CentOS 7.1, and Mac OS X 10.11 上运行。”
    (The downloads for the alpha version of PowerShell built in the PowerShell repo that work on: Ubuntu 14.04/16.04, CentOS 7.1, and Mac OS X 10.11.)

    另外,他们团队做的小视频也蛮好玩的:

    14 replies    2016-08-20 08:48:53 +08:00
    jyf007
        1
    jyf007  
       Aug 19, 2016 via Android
    mono 一包 400Mib
    feather12315
        2
    feather12315  
       Aug 19, 2016 via Android
    昨天在一 Windows 上用 PowerShell ,难用难用难用…
    zpole
        3
    zpole  
       Aug 19, 2016 via iPhone
    放着 bash/zsh 不用你让我用 powershell ?
    missdeer
        4
    missdeer  
       Aug 19, 2016
    估计没啥人用,在 Windows 上就很多人宁可用移植的 cygwin/msys ,更别说 Mac 和 Linux 用户了
    EchoChan
        5
    EchoChan  
       Aug 19, 2016   ❤️ 1
    挺好的,冷嘲热讽的是什么鬼。
    tairan2006
        6
    tairan2006  
       Aug 19, 2016
    powershell 比 bash 好

    但是我写 python 啊…
    odirus
        7
    odirus  
       Aug 19, 2016
    其实我灰常喜欢微软的产品, powershell 也有牛逼的一面,只要配置得当,确实非常顺手

    同时我也喜欢 zsh 这种产品,两者都需要打磨,打磨好了就是自己的得力助手。
    mcfog
        8
    mcfog  
       Aug 19, 2016
    fish 飘过
    ivmm
        9
    ivmm  
       Aug 19, 2016
    powershell 和 bash 的优劣。。。 谁能给我科普一下
    longaiwp
        10
    longaiwp  
       Aug 19, 2016
    这里足以说明,产品的好坏不是问题根源,而是屁股
    itisthecon
        11
    itisthecon  
       Aug 19, 2016 via Android
    谁能科普下 PowerShell 到底比 bash 好在哪
    hyq
        12
    hyq  
       Aug 19, 2016
    powershell 的管道支持传送对象, bash 的只支持传送文本

    比如获取 WeChat 进程的 pid
    powershell:
    get-process|%{if($_.ProcessName.Equals("WeChat")) {echo $_.Handles}}

    bash:
    ps aux|grep WeChat|grep -v grep|awk '{print $2}'
    pagxir
        13
    pagxir  
       Aug 19, 2016
    这个例子只证明了 powershell 难用, 后面那么复杂的长串是啥意思,难道还让人去查一个 object 导致支持那些 method 。一个好的 shell 应该是各种工具的粘合剂,而不是试图代替原来其他正终语言的领域。

    其实,一个 shell 用来处理交互,一个脚本语言写写小工具,一个正式的语言写些比较正规程序,没有必要都混一起。试图把 python 代替 shell 来用,绝对是坑爹的事情。
    toadloading
        14
    toadloading  
    OP
       Aug 20, 2016
    @pagxir 也许换个语法会好理解一点(我的电脑上没有 WeChat ):

    > Get-Process | where name -EQ 'firefox' | select name, id

    Name Id
    ---- --
    firefox 944
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   1106 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 61ms · UTC 18:39 · PVG 02:39 · LAX 11:39 · JFK 14:39
    ♥ Do have faith in what you're doing.