I am not a big PowerCLI user, primary reason being that I don’t even have a Windows box available. My main laptop is a macbook, and I don’t run Windows anywhere. Yesterday PowerCLI 10.0.0 was released, which includes support for OSX! Before you can install PowerCLI of course you would need to have Powershell running, I tried different ways as described here, but the Homebrew method threw an error (see below) so I used the direct download option and just installed the package, which worked fine.
failed command: /usr/bin/sudo -E -- /usr/sbin/installer -pkg /usr/local/Caskroom/powershell/6.0.1/powershell-6.0.1-osx.10.12-x64.pkg -target
When installed you simply open a terminal and type “pwsh”. Weird thing is that many blogs seem to state that you type “powershell”, but for me that doesn’t work either. So either recently something changed, or people have been blatantly copying procedures from the same source, didn’t bother checking why… waiting for Alan to comment. Then you type the following in the Powershell to get the PowerCLI module installed:
Install-Module -Name VMware.PowerCLI -Scope CurrentUser
What may be useful to change is the certificate handling. As mentioned by Kyle in this blog, the way PowerCLI handles certificate issues has changed, so go to his blog to figure out how to disable it. I will now go explore some of the vSAN PowerCLI cmdlets, haven’t done anything in ages with PowerCLI, so this will be a day with me yelling at the monitor why stuff doesn’t work and then realizing I made a stupid typo.
Robert van den Nieuwendijk says
You can start PowerShell Core on Windows, Linux and MacOS X with the pwsh command. Windows PowerShell can be started with the powershell command. On a Windows system, you can install Windows PowerShell and PowerShell Core side by side. The new pwsh command is introduced to make a difference between the two PowerShell versions.
Duncan Epping says
Thanks for that Robert, I haven’t followed this space in a long time so had no clue. Was simply doing what others wrote, I guess they copied/pasted from old procedures without thinking/validating :-/
Fred says
Anyone else have issues when running powershell on the mac with the carriage return line feed after every character when typing? For example I get this when typing ‘help’:
[FredBox:~] Fred% pwsh
PowerShell v6.0.1
Copyright (c) Microsoft Corporation. All rights reserved.
https://aka.ms/pscore6-docs
Type ‘help’ to get help.
$PS /Users/Fred> h
$PS /Users/Fred> he
$PS /Users/Fred> hel
$PS /Users/Fred> help
Duncan Epping says
have not experience that myself yet…
Eric says
If you’re lazy like me, you can use automator to script the opening of powershell, and the import of the powercli module, and create an application package that is searchable in spotlight.
I can share my automator script tomorrow if you’d like.