Step 1 – Download and Install .NET Core for Mac OS X from here
https://www.microsoft.com/net/core#macos
- brew update
- brew install openssl
- ln -s /usr/local/opt/openssl/lib/libcrypto.1.0.0.dylib /usr/local/lib/
- ln -s /usr/local/opt/openssl/lib/libssl.1.0.0.dylib /usr/local/lib/
Step 2 – Download and Install PowerShell for Mac OS X using the instructions and packages this will also include the install of homebrew
https://github.com/PowerShell/PowerShell
-
Sudo installer -pkg powershell-6.0.0-alpha.10.pkg -target /
Step 3 – Perform the following steps to ensure you are using the latest OpenSSL and Curl:
- brew install openssl
- brew install curl –with-openssl
- sudo install_name_tool -change /usr/lib/libcurl.4.dylib /usr/local/opt/curl/lib/libcurl.4.dylib /usr/local/microsoft/powershell/6.0.0-alpha.10/System.Net.Http.Native.dylib
- sudo install_name_tool -add_rpath /usr/local/opt/openssl/lib /usr/local/microsoft/powershell/6.0.0-alpha.10/System.Security.Cryptography.Native.dylib
Step 4 – Create the following directory if it does not exists by running the following command:
- mkdir -p ~/.local/share/powershell/Modules
Step 5 – Extract the PowerCLI modules into the directory you created above by running the following command:
- Copy the unzip files to ~/.local/share/powershell/Modules
- unzip PowerCLI.ViCore.4523941.zip -d ~/.local/share/powershell/Modules
- unzip PowerCLI.Vds.4523941.zip -d ~/.local/share/powershell/Modules
Launch PowerShell
Step 1 – Open terminal
Step 2 – Start Powershell in the terminal by running the following command: powershell
Step 3 – Import the PowerCLI Modules into your PowerShell Session: Get-Module -ListAvailable PowerCLI* | Import-Module
Step 4 – Connect to your vCenter Server using
Connect-VIServer PS> Connect-VIServer -Server 192.168.1.51 -User administrator@vSphere.local -Password VMware1! Name Port User —- —- —- 192.168.1.51 443 VSPHERE.LOCAL\Administrator