PowerShell 学习笔记——PS On MacOS

发布时间:2020-07-20 11:41:51 作者:loveunicom
来源:网络 阅读:1384

 PowerShell 学习笔记——PS On MacOS 

I remember that there is a command line tool on Mac OS X using for connecting to Microsoft Azure.  But now, Microsoft is developing MacOS version PowerShell – PowerShell for MacOS v6.0 alpha.  Let’s see it.

1. Download the pkg setup file

You can visit Github website and find the PowerShell repo here: https://github.com/PowerShell/PowerShell, then scroll down to “Get PowerShell” section.  There is a table, find “macos 10.11” line and click “pkg” link, then download will begin.

PowerShell 学习笔记——PS On MacOS

PowerShell 学习笔记——PS On MacOS

PowerShell 学习笔记——PS On MacOS

After finishing your download, find the file in your Download folder and double click it to begin installation.

PowerShell 学习笔记——PS On MacOS

PowerShell 学习笔记——PS On MacOS

If you prefer command line tool to setup PowerShell, it’s OK, here it is:

sudo installer -pkg powershell-6.0.0-alpha.16.pkg -target /

Open a terminal window, copy and paste above command, then press Enter key to run.  Microsoft provides a installation instruction here: https://github.com/PowerShell/PowerShell/blob/master/docs/installation/linux.md#macos-1011, read it carefully.

2. OpenSSL

To follow the instruction, you also need to setup OpenSSL because most networking functions do require OpenSSL to work properly.  On the instruction page, scroll down to “OpenSSL” section, click “their instructions” link, follow the instructions to finish installing Homebrew.

PowerShell 学习笔记——PS On MacOS

Now you must go back to the macos installation instruction page and run the commands list on the page.

brew install openssl
brew install curl --with-openssl

Then for security, you need to patch .NET Core’s cryptography libraries:

find ~/.nuget -name System.Security.Cryptography.Native.dylib | xargs sudo install_name_tool -add_rpath /usr/local/opt/openssl/lib
find ~/.nuget -name System.Net.Http.Native.dylib | xargs sudo install_name_tool -change /usr/lib/libcurl.4.dylib /usr/local/opt/curl/lib/libcurl.4.dylib

3. Try PowerShell Commands in MacOS Terminal

Now you can open a terminal to try this alpha version of PowerShell by typing “powershell” in the terminal window and pressing Enter key, you will enter PS enviroment.

PowerShell 学习笔记——PS On MacOS

Let’s try some cmdlets.

PowerShell 学习笔记——PS On MacOSPowerShell 学习笔记——PS On MacOS


推荐阅读:
  1. 为什么要学习PowerShell——PowerShell三分钟(一)
  2. PowreShell场景:自动添加OU用户到指定的组

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

powershell macos 英文博客

上一篇:连接mongodb数据库的方法

下一篇:如何实现css3动画属性之Transitions属性与Animations属性的功能

相关阅读

您好,登录后才能下订单哦!

密码登录
登录注册
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》