php 执行powershell,在 Linux 上运行 PowerShell

PowerShell 全称 Windows PowerShell,在开发之初,微软将其命名为代号 Monad。它首先是个 Shell,它能够启动和操纵应用程序;其次 PowerShell 也可以将几个命令组合起来放在文件中执行;同时,PowerShell 还可以充分利用 .Net 和 COM 对象,来与各种系统交互,完成各种复杂、自动化的操作。

PowerShell 这个原本只是 Windows 才能使用的组件,于 2016 年 8 月 18 日开源并且成为跨平台软件 ,登陆了 Linux 和 macOS。

如今,你可以在 GitHub 上下载,并体验 PowerShell 和他的开源态度;当然你也可以在在开源网站上下载并学习 PowerShell 资料库。微软的纳德拉说:我爱 Linux,你觉得这事儿靠谱吗?不如先行试用。

在 Linux 系统中安装 PowerShell

Ubuntu 14.04

curl https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add -

curl https://packages.microsoft.com/config/ubuntu/14.04/prod.list | sudo tee /etc/apt/sources.list.d/microsoft.list

sudo apt-get update

sudo apt-get install -y powershell

powershell

Ubuntu 16.04

curl https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add -

curl https://packages.microsoft.com/config/ubuntu/16.04/prod.list | sudo tee /etc/apt/sources.list.d/microsoft.list

apt-get update

apt-get install -y powershell

powershell

CentOS 7

sudo curl https://packages.microsoft.com/config/rhel/7/prod.repo > /etc/yum.repos.d/microsoft.repo

sudo yum install -y powershell

Debian Kali

下载 PowerShell-x86_64.AppImage

chmod +x PowerShell-x86_64.AppImage

./PowerShell-x86_64.AppImage

1460000008861305

获取 PowerShell 命令列表

get-command

1460000008861306

查看命令帮助 get-help command 比如 get-help Get-Process

get-help Get-Process

1460000008861307?w=756&h=1012

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值