At this time, it does not look like the Update-Help Cmdlet is supported for Mac or Linux. For the time being I would suggest going to the technet website for each help file.
- Milan, I believe the open source community will add the features that PowerShell needs to compete with other shells and scripting languages. I think this is the main reason why Microsoft open sourced PowerShell. Without this move PowerShell's future on Linux and OS X would be rather grim. PowerShell is well-designed and extremely popular.
- Installing PowerShell on macOS.; 5 minutes to read +2; In this article. PowerShell supports macOS 10.12 and higher. PowerShell 7.0.3 or higher and PowerShell Preview 7.1.0 or higher require macOS 10.13 and higher.
The majority of my PowerShell code is written in a Windows VM where all the typical native PowerShell tools are available. However, occasionally I may want to quickly view or make small changes to some code in OS X. It’s possible via the built-in TextEdit application, but that’s kind of the equivalent of using Notepad on Windows, i.e. a pretty basic experience.
I recently read this review of Text Editors on The Register and decided to check out Sublime after discovering PowerShell could be added as an additional language to support syntax highlighting.
First of all download and install Sublime (available for OS X, Windows and Linux). To add PowerShell syntax highlighting:
1) Download the zip file from https://github.com/SublimeText/PowerShell
2) Unzip and move the contents to UsersUsernameLibraryApplication SupportSublime Text 2Packages
Note: I couldn’t track this down at first, the instructions stated to copy to the Packages folder, but not exactly where that would be. Fortunately, there is a menu item which will take you straight there:
3) Restart Sublime and now PowerShell v2 will be listed as an available syntax
Now you can work with PowerShell (and other) code in a nice interface
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!
Unix For Mac Os X Users With Kevin Skoglund
Let’s put this to action and get PowerCLI installed on a MacOS system.
Mac Shell Commands
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
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:
/usr/bin/ruby-e'$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)' |
Next, we’ll need to install Homebrew-Cask. Homebrew-Cask is extension of Homebrew to allow for the downloading of additional, pre-compiled, applications. We will perform the install with the following command within Terminal:
Now, we’re ready to install PowerShell onto our MacOS system! This can be done with the following command within Terminal:
Installing PowerCLI
We have our prerequisite of PowerShell installed on our MacOS system. We’re now ready to install PowerCLI!
Start by opening Terminal and starting our PowerShell session by entering:
At this point, we’re in PowerShell so we install PowerCLI just like we have for the past couple versions!
Example:
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
Shortcut To Open Powershell
Some cmdlets, even though they may be in the above list, also still may not function properly. Examples:
- Get-VICredentialStoreItem
- New-VICredentialStoreItem
- Remove-VICredentialStoreItem
- Get-VMHostHardware
- Open-VMConsoleWindow
Powershell For Mac
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!