A Hitchhikers Guide to SRS 1.0.0

Sometimes announcements tend to disappear in the cracks of time. When the Script Runtime Service for vSphere (SRS) 1.0.0 was announced, I had the feeling just that happened.

When version 1.0.0 of this open-sourced (!) product was released, I had expected much more buzz on social media from VMware PowerCLI users. 

This appliance does in fact bring an answer to a wish that many PowerShell/PowerCLI users have had for years: a “Scripting Host“!

This Hitchhikers Guide to SRS 1.0.0 post will show how I build my own customised SRS appliance, and how I use it to run PowerShell/PowerCLI scripts.

Continue reading A Hitchhikers Guide to SRS 1.0.0

How to Mount a Content Library ISO on a VM

While Content Libraries are becoming more and more used, there are still some features that are not yet implemented in PowerCLI. So is it for example not possible to mount an ISO file located in a Content Library on a VM. The Set-CDDrive cmdlet is currently lacking this functionality, while the Web Client offers this option.

Like often, and one of the VMware PowerCLI features I absolutely like, when a cmdlet is missing a feature, you can fall back on the API to solve the issue.

Continue reading How to Mount a Content Library ISO on a VM

Crescendo ma non troppo

No, this is not a post about music.

This post will be about my first experiences with the PowerShell Crescendo module, which was just released in Preview 1.

Now, why would I care to write a post about a preview of a module?

The reason is quite simple. This module is, in my opinion, covering something that was missing in PowerShell. Namely the possibility to use native commands, and present the results as objects.

The blog post by Jason Helmick I linked to earlier explains this all in more detail.

What follows are my first, admittedly simple, trials using the Crescendo module. If you don’t want to copy code from this post, I created the VMW-Crescendo repository that contains all the files.

Continue reading Crescendo ma non troppo

Cloud-init – Part 5 – Running Containers

In this last part of this series (for now) we will show how to use containers to run your PowerShell/PowerCLI scripts on the deployed instances. And although technically not a ‘real‘ cloud-init post, I consider it related to Part 1Part 2 and Part3 in this series. 

Continue reading Cloud-init – Part 5 – Running Containers

Cloud-init – Part 4 – Running Scripts

For now, the second to last part in this series. And although technically not a ‘realcloud-init post, I consider it related to Part 1, Part 2 and Part3 in this series. In this post I’ll show how you can run scripts on these ‘cattle‘ stations we just deployed.

Continue reading Cloud-init – Part 4 – Running Scripts

Cloud-init – Part 3 – Photon OS

In Part 1 and Part 2 of this series we used Ubuntu as the guest OS of our target instances. In Part 3 we will show how to use VMware’s Photon OS as our guest OS.

The main reason to use Photon OS is that it is open-sourced, it has a small footprint and it is optimised for VMware vSphere.

Continue reading Cloud-init – Part 3 – Photon OS

Cloud-init – Part 2 – Advanced Ubuntu

In Cloud-init – Part 1 – The Basics, we laid the groundwork for using cloud-init in a vSphere environment. In this post we will go into more advanced Ubuntu setups. This includes deploying PowerShell, v6 and v7, using repositories and if needed, a GUI with Visual Studio Code.

Continue reading Cloud-init – Part 2 – Advanced Ubuntu

Cloud-init – Part 1 – The Basics

One of the important DevOps adagios in my book is “Treat your servers as cattle, not as pets”. Meaning that you roll out your stations when you need them, use them and throw them away after you used them. This series of posts will document one such way of deploying such ‘cattle’ stations. The method is named cloud-init.

Post logo

In this first part, we will introduce cloud-init and how you can use it from your PowerShell/PowerCLI scripts. Since the Ubuntu distribution is very popular, on-premises and in the cloud, this introduction will focus on that distro to demonstrate the concept. In the following parts, we will tackle Photon, containers and how to run your scripts on these stations.

Continue reading Cloud-init – Part 1 – The Basics

Invoke-VMScriptPlus v3

My InvokeVMScriptPlus function serves me well while interacting with the guest OS on a VM. And I’m apparently not the only one that uses the function. This post introduces Invoke-VMScriptPlus v3.

The original Invoke-VMScriptPlus post, and the addition of PS Core support, described in the Invoke-VMScriptPlus v2 post, keep being some of my most read posts. Time for another update.

In this v3 version, I introduce some new features to the function.

  • PSv6 and PSv7 support
  • Use files (input and output) from within your scripts
  • improved sudo support

Update July 2nd 2021

  • Fixed incorrect variable NameHost
  • Added tests to detect IP or FQDN in URI
  • Updated test to check if type TrustAllCertsPolicy exists or not

Update April 15th 2020

  • Added SkipCertificateCheck switch

Update January 16th 2020

  • Bug fix which occured when connected to an ESXi node

Update November 18th 2019

  • Added NoIPinCert switch
Continue reading Invoke-VMScriptPlus v3

At Your Fingertips

How often have you been finding out the PowerShell version you were using, or to which vSphere Server you were connected, or in which git repo/branch your code was being stored, or… Despair no more, it can now be available at your fingertips.

The following is a write up of a part of session HBI1729BU ,that was presented at VMworld US 2019.

The code shown in this post is also available in the PowerCLI Community Repository.

Continue reading At Your Fingertips