PowerShell 学习笔记——PS On MacOS

系统运维

? 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.

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

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.

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.

Let’s try some cmdlets.

更多关于云服务器域名注册虚拟主机的问题,请访问西部数码官网:www.west.cn

赞(0)
声明:本网站发布的内容(图片、视频和文字)以原创、转载和分享网络内容为主,如果涉及侵权请尽快告知,我们将会在第一时间删除。文章观点不代表本网站立场,如需处理请联系客服。电话:028-62778877-8306;邮箱:fanjiao@west.cn。本站原创内容未经允许不得转载,或转载时需注明出处:西部数码知识库 » PowerShell 学习笔记——PS On MacOS

© 2010-2024   西部数码知识库   西部数码旗下IDC知识库,为您提供域名注册,域名交易,虚拟主机,云服务器,云计算,网站建设等领域专业的知识介绍!

川B1.B2-20080058号

wordpress template system recommended themebetter

请求次数:59 次,加载用时:0.274 秒,内存占用:8.57 MB

登录

找回密码

注册