I know you must be confused that installing PowerShell on a Mac is this even possible? Yes, it is, Microsoft supports PowerShell on the Mac, and, with the help of a few commands; you can have a PowerShell running on your Mac.
PowerShell is cross-platform automation and configuration tool that combines a scripting language with a more advanced version of a command-line shell, it is compatible with both Linux and Mac. Yes, you heard that right, now you can also install and use PowerShell on your Mac anytime.
Mac OS does not come with its own package to install PowerShell, you have to download official packages from Microsoft to actually install PowerShell on your Mac. If you have not downloaded a PowerShell before or you are generally new to PowerShell, and you are confused about how to do so, worry not. In today’s guide, I am going to show you how you can too install PowerShell and use it on your macOS.
What is PowerShell and Why it is so Powerful?
A PowerShell is the most advanced featured command-line shell which allows you to even replace CMD. It is a complete scripting language that also provides lightweight and easy-to-understand commands at run-time which is great as it helps you to be more productive and does not waste your time writing long commands.
The main reason why PowerShell is more popular than CMD is that it’s more powerful and used different commands altogether. PowerShell is specially made for the system administrations to automate systems management and to build, test, and deploy solutions in CI/CD environments.
What is the benefit of installing PowerShell?
PowerShell is very powerful as it also includes several features and benefits which everybody wants to use for their system management. Which has automatically improved its usability too. PowerShell is designed to extend the capabilities of the command line to run powerShell commands called cmdlets. This is the reason why Mac users want to install and use PowerShell on their macOS.
How can I install PowerShell on Mac?
If you are a Mac user and don’t know how to install PowerShell then, just follow these steps to easily install PowerShell on your macOS. Remember that to install PowerShell version 7.0 or higher on your Mac, you need to have macOS 10.13 or a higher version.
Three different ways to download PowerShell on macOS:
- Installing PowerShell on macOS using Homebrew Utility.
- Installing PowerShell on macOS with the help of binary archives.
- Installing PowerShell on macOS by Direct Download.
In all the above-given ways, you can choose any of the download method to install PowerShell on your macOS. Here, we are going to discuss all of the three methods today and then you can select your desired process you want to use to install PowerShell on your MAC:
1# Installing PowerShell on macOS using Homebrew Utility:
- First of all, Go to Application > Utilities, and open the terminal.
- Copy the given command and paste it into your Mac Terminal’s Window:
/bin/bash -c “$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)”
3. Now, press Enter to run the command. You will probably be asked to type in your admin password before the command is executed. Type your password before the command is executed. After typing a password, hit Enter again and the command to install Homebrew will be executed.
4. Now, the homebrew is available on your macOS.
5. Once Homebrew is installed, Install PowerShell using the following command:
brew install –cask powershell
6. At last, run the pwsh command to enter PowerShell and verify that it is working properly or not.
Once the installation is complete, open your Mac’s terminal Window and run powershell. After you do this you will be executed to the PowerShell commands.
How to update PowerShell to new version:
If ever, a new version of powerShell comes across to you, then you can easily upgrade your PowerShell with the help of your Mac Terminal. You just have to update Homebrew first. To do that use the following commands to update your PowerShell to the updated version:
- brew update
- brew upgrade powershell -cask
2# Installing PowerShell on macOS using Binary Archives:
To install PowerShell with the use of Binary Achieves, you need to download the tar.gz file first of the latest release of PowerShell.
- To download the latest release of the PowerShell just run the following command to directly download the binary archive: curl -L -o /tmp/powershell.tar.gz https://github.com/PowerShell/PowerShell/releases/download/v7.1.4/powershell-7.1.4-osx-x64.tar.gz
- Create a new folder to place the PowerShell binary archive files.
- Now, extract all the binary archive files to the new folder you just created.
- Set the execute permission for the PowerShell application on your macOS.
- Create a symbolic link for the pwsh application file.
- When you choose the binary method for installation, you also need to install all the dependencies on your own.
3# Installing PowerShell on macOS by Direct Download Method:
This will be the easiest and simplest way of downloading PowerShell on macOS.
- First of all, visit GitHub and then download the .pkg file of the latest version of the PowerShell release.
- Once the file is downloaded, you need to find the download and right click and choose open.
- Or double click the .pkg file to open the PowerShell installation or you can also run the following command directly into your Mac Terminal.
sudo installer -pkg powershell-7.1.4-osx-x64.pkg -target /
3. And you are done, this command will automatically going to install PowerShell on your macOS or you can start PowerShell on your Mac by execute the pwsh command in your Terminal. After doing that you can easily start using PowerShell.
To finish this off, it is a great thing that you can install PowerShell on the macOS. Installing PowerShell is the easiest thing to do and it has a very straightforward process. There are many different methods to do so but, you can use your desired method to install it. We have provided you with some steps and instructions to understand how to install the PowerShell using three different ways. I hope, after reading this article you realize how easy to install PowerShell on macOS.