WilliamLam.com

  • About
    • About
    • Privacy
  • VMware Cloud Foundation
  • VKS
  • Homelab
    • Resources
    • Nested Virtualization
  • VMware Nostalgia
  • Apple

How to install PowerCLI Core on Debian Linux?

01.04.2017 by William Lam // 6 Comments

PowerCLI Core has been tried on two Linux distributions: VMware's Photon OS and Ubuntu 14.04, however that is not to say it would not work on other distros. In fact, .Net Core (which PowerCLI Core consumes) supports a variety of Linux distributions which can be found here. I recently needed to run PowerCLI Core on a Debian 8 system which required a few minor tweaks to get working. I figure I might as well document the steps in case this might help others wanting to use PowerCLI Core which now includes PowerNSX on a Debian system.

Step 1 - Append the following repo source to /etc/apt/sources.list configuration file:

deb http://ftp.de.debian.org/debian sid main

Step 2 - Run the following command to update the repo

apt-get update

Step 3 - Download .deb package for latest Powershell release and run the following command which will generate list of required dependencies:

wget https://github.com/PowerShell/PowerShell/releases/download/v6.0.0-alpha.14/powershell_6.0.0-alpha.14-1ubuntu1.16.04.1_amd64.deb
dpkg -i powershell_6.0.0-alpha.14-1ubuntu1.16.04.1_amd64.deb

Step 4 - Run the following command to install powershell along with its dependencies:

apt-get -f install

Step 5 - The next series of commands will download and setup PowerCLI Core:

mkdir -p /powershell
wget https://download3.vmware.com/software/vmw-tools/powerclicore/PowerCLI_Core.zip -O /powershell/PowerCLI.ViCore.zip
apt-get -y install unzip
unzip /powershell/PowerCLI.ViCore.zip -d /powershell
mkdir -p /root/.config/powershell/
mkdir -p ~/.local/share/powershell/Modules
unzip /powershell/PowerCLI.ViCore.zip -d ~/.local/share/powershell/Modules
unzip /powershell/PowerCLI.Vds.zip -d ~/.local/share/powershell/Modules
mv /powershell/Start-PowerCLI.ps1 /root/.config/powershell/Microsoft.PowerShell_profile.ps1

Step 6 (Optional) - Install PowerNSX module:

wget https://github.com/vmware/powernsx/archive/master.zip -O /powershell/master.zip
unzip /powershell/master.zip -d /powershell/
mkdir ~/.local/share/powershell/Modules/PowerNSX
cp /powershell/powernsx-master/PowerNSX.ps*1 ~/.local/share/powershell/Modules/PowerNSX/

If everything installed successfully, you should be able to now launch PowerCLI Core by simply typing "powershell"

Categories // Automation, PowerCLI Tags // debian, linux, PowerCLICore

'System.Management.Automation.ConfigPropertyAccessor' exception when launching PowerCLI Core in Linux firstboot script

01.03.2017 by William Lam // Leave a Comment

Happy New Years everyone!

I just got back into the swing of things after taking some much needed time off over the holiday break. While catching up on my email, I also re-visited one of my pet projects I had been working on right before the break. I needed to launch a specific PowerCLI script upon firstboot from a Linux system, specifically PhotonOS leveraging PowerCLICore. My first few attempts had failed and in troubleshooting the issue further, I found the following cryptic error message in the system logs:

The shell cannot be started. A failure occurred during initialization:
The type initializer for 'System.Management.Automation.ConfigPropertyAccessor' threw an exception.

After a bit of Googling, I found the following Github PR which seems to indicate that the HOME environmental variable may not properly configured or readable by Powershell. The quick fix was to simply define the HOME directory within the shell script that starts up the PowerCLI script.

Below is a snippet of what I needed to add to /etc/rc.d/rc.local to automatically run my PowerCLI script:

export HOME=/root

/usr/bin/powershell -File /root/MyPowerCLI-Script.ps1

The following command was also useful in troubleshooting and verifying that my PowerCLI script had properly executed since there was no output in my script log:

journalctl --no-pager | grep rc.local

Categories // Automation, PowerCLI Tags // linux, Photon, PowerCLICore

VMware PowerCLI for Mac OS X, Linux & More? Yes, please!

09.06.2016 by William Lam // 10 Comments

powercli_for_mac_osx_linux_1There were a several announcements at last weeks VMworld US Conference, but one of the most exciting piece of news in my opinion was from Alan Renouf, Product Manager for all things API/SDK/CLI at VMware. During Alan's What's New PowerCLI session, he announced that PowerCLI is finally coming to both Mac OS X as well as Linux! As you can imagine, the news was very well received from customers and partners. In fact, after I had tweeted the update here & here, I literally had folks pinging/IM'ing/DM'ing me non-stop about when they could get access 🙂

UPDATE (10/18/16) - PowerCLI Multi-Platform (MP) for Linux and Mac OS X has now been released as a VMware Fling. Please find the download here and provide any feedback in the comments section.

This exciting update was only possible with the help of our friends over at Microsoft who had recently open sourced both .NET Core & PowerShell. Once that news broke, Alan and the PowerCLI Engineering team have been working hard on porting over the existing PowerCLI code which uses the Windows .NET library over to the new .NET Core which is now open sourced. I have been very impressed at how fast the PowerCLI team have already made available many of the default cmdlets as well as the Get View cmdlet which exposes the entire functionality of the vSphere API.

Now, before you get too excited, this new version of PowerCLI is currently not available yet. As Alan mentioned in his session, we plan to release an early Tech Preview of PowerCLI for both Mac OS X and Linux as a VMware Fling shortly after VMworld. It is also very important to note that Microsoft PowerShell for Mac OS X & Linux which PowerCLI uses is just at an Alpha release milestone. There is still much work to do on both sides but I am really looking forward to enabling our customers with the choice of platform when it comes to consuming PowerCLI.

powercli_for_mac_osx_linux_2
A few of us have been quite fortunate to have been involved in the early development of this new version of PowerCLI. In fact, we even built a simple Docker Container for PowerCLI which will allow you to easily access PowerCLI from any system that can run Docker. Here is a quick screenshot of spinning up a PowerCLI Docker Container which will also be part of the Fling release.

powercli_for_mac_osx_linux_3
Lastly, we want customers to be able to quickly and securely set up a persistent PowerCLI environment in which they can use to manage and configure their VMware-based products that support PowerCLI. With that, we have also built a PowerShell package for Photon OS which is VMware's minimal Linux container host distribution. Not only is it free to download and use, but it literally takes a few seconds to install (tdnf -y install powershell) and even less time to boot up and import the PowerCLI module. This was literally done the week before VMworld by the Photon team and huge kudos for their support! As you can see, not only do we want to provide choice for our customers but also simplifying how you might consume PowerCLI whether its natively on Windows, Mac OS X, Linux, Docker Container or running on top of VMware Photon OS. I hope you are excited as I am and stay tuned for more details on the Fling release!

If you have any feedback or what you are most excited regarding this news, please leave a comment and I will make sure it makes it way back to our Product Manager.

Categories // Apple, Automation, Docker, PowerCLI Tags // Docker, linux, Microsoft, osx, Photon, PowerCLI, PowerCLICore, powershell, vSphere

  • « Previous Page
  • 1
  • 2

Search

Thank Author

Author

William is Distinguished Platform Engineering Architect in the VMware Cloud Foundation (VCF) Division at Broadcom. His primary focus is helping customers and partners build, run and operate a modern Private Cloud using the VMware Cloud Foundation (VCF) platform.

Connect

  • Bluesky
  • Email
  • GitHub
  • LinkedIn
  • Mastodon
  • Reddit
  • RSS
  • Twitter
  • Vimeo

Recent

  • Programmatically accessing the Broadcom Compatibility Guide (BCG) 05/06/2025
  • Quick Tip - Validating Broadcom Download Token  05/01/2025
  • Supported chipsets for the USB Network Native Driver for ESXi Fling 04/23/2025
  • vCenter Identity Federation with Authelia 04/16/2025
  • vCenter Server Identity Federation with Kanidm 04/10/2025

Advertisment

Privacy & Cookies: This site uses cookies. By continuing to use this website, you agree to their use.
To find out more, including how to control cookies, see here: Cookie Policy

Copyright WilliamLam.com © 2025

 

Loading Comments...