Powershell Mac Os X



PowerCLI 10.0.0 was released just a few weeks ago and one of the key updates was the added support for MacOS and Linux operating systems. It’s still amazing to think about! PowerShell and PowerCLI available to users on OSes other than just Windows. Wow!

Let’s put this to action and get PowerCLI installed on a MacOS system.

Prerequisite: Installing PowerShell Core – Package

The minimally required version for MacOS is PowerShell Core 6.0.1. There’s a couple different ways to install PowerShell onto a MacOS system. This first method is downloading the PowerShell package and installing it through GUI installer.

We can start by browsing to the PowerShell GitHub repository, and clicking on the ‘Releases’ button. Alternatively, here’s a direct link: PowerShell Releases page

On the PowerShell Releases page, we will want to download the latest MacOS package to our local system. Now, we will want to run through the installer. Accepting all of the defaults worked in my environment.

Prerequisite: Installing PowerShell – Homebrew

That’s it, you’ve installed PowerShell on Linux. To those of us that have been in tech for more than a few years, that is a very odd sentence to type. Well, first you’ll need to launch it. Open your terminal and depending on the version of Linux/Mac OS X and the package you’ll need to type either powershell or pwsh to access it. Run PowerShell on Mac OS X. PowerShell is a command-prompt in your terminal window, so to start it: Mac mini high sierra download. Global Nav Open Menu Global Nav Close Menu; Apple; Shopping Bag +. A copy of the macOS High Sierra Installer App.

The other main way of installing PowerShell is through Homebrew. Homebrew is a package manager. It will easily allow us to install, update, and remove packages, like PowerShell, directly from the command line!

If you don’t already have Homebew installed, it too can be installed from the command line with the following within Terminal:

Install-Module-NameVMware.PowerCLI-ScopeCurrentUser

At this point, we’re all set! We can start using PowerCLI just like we normally have on Windows systems for years!

Couple Things to Keep in Mind

There are still a couple things to keep in mind as you move forward in the excitement of having PowerCLI on a non-Windows system. PowerShell Core, as well as the underlying .NET Core, are not feature complete to their non-Core counterparts. Make sure to test your scripts thoroughly prior to using them. A recent example that was brought up within the PowerCLI channel in the VMware Code Slack group: ConvertFrom-SecureString doesn’t currently work, as per Issue 1654. Therefore, if you have any scripts containing secure string objects, PowerShell Core will not be able to decrypt them.

The PowerCLI 10.0.0 release starts with support for the following modules, and the rest of the modules will be added over time:

  • VMware.VimAutomation.Cis.Core
  • VMware.VimAutomation.Common
  • VMware.VimAutomation.Core
  • VMware.VimAutomation.Nsxt
  • VMware.VimAutomation.Vds
  • VMware.VimAutomation.Vmc
  • VMware.VimAutomation.Sdk
  • VMware.VimAutomation.Storage
  • VMware.VimAutomation.StorageUtility

Some cmdlets, even though they may be in the above list, also still may not function properly. Examples:

Powershell On Mac Os X

  • Get-VICredentialStoreItem
  • New-VICredentialStoreItem
  • Remove-VICredentialStoreItem
  • Get-VMHostHardware
  • Open-VMConsoleWindow

Wrap-Up

The PowerCLI 10.0.0 release added the much requested support for MacOS and Linux systems! In this blog, we walked through two different methods to make PowerShell Core available on MacOS and how to install PowerCLI.

Let us know what you’re most excited about now that PowerCLI works on multiple OSes!

PowerShell is an amazing command line, scripting & programming tool that I have used a few times on Microsoft Windows. PowerShell Core is now available for Mac OS and so today I am going to look at installing it on my MacBook.

Note: I am installing PowerShell Core onto Mac OS Mojave (specifically Mac OS 10.14.5).

The recommended approach to install PowerShell Core on Mac OS is to use Homebrew (https://brew.sh/). Homebrew adds additional features to Mac OS that power users will probably find very helpful. For a list of the additional features see https://formulae.brew.sh/formula/

If you do not have Homebrew installed then it can be installed via the following 1 line command in the terminal:

/usr/bin/ruby -e “$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)”

I recommend visiting https://brew.sh/ before installing Homebrew.

With Homebrew installed we can ask it to install PowerShell Core using the command:

Powershell Core Mac Os X

brew cask install powershell

Azure Powershell Mac Os X

Mac

Powershell Mac Os X

If Homebrew successfully installs PowerShell it should show a message of a beer and a success message. PowerShell can then be started using the command:

pwsh

Run Powershell On Mac Os X

And then the PowerShell command prompt will show.