How To Make Use Of Functions in PowerShell

Over the last few weeks I’ve had a number of comments on posts essentially asking the same question: “How do I use the functions that you publish on your blog?”. So I thought it worth making a post to refer people to, rather than trying to respond in kind to each comment. There are a number of ways it can be done depending on your requirements and they are listed below.

Presenting a Password Confirmation Form in vCO / vRO

Requirement: Present a vCO / vRO form which contains two password entry fields using SecureStrings and a field which displays whether the two entered passwords match. Using an if statement to test whether two SecureStrings are equal will fail even if the text entered is identical. As mentioned in this communities post, in a workflow it is possible to take the SecureStrings into a scriptable task and output them as Strings.

Enabling NFS VAAI Support in Synology 5.1

Synology enabled VAAI support for NFS in version 5.1 of their DSM software. In order to take advantage of this technology from ESXi hosts we need to do two things: Upgrade DSM to at least version 5.1-5004 (2014/11/06) Install the Synology NFS Plug-in for VMware VAAI DSM DSM can be upgraded from within the Control Panel application. Head to the Update & Restore section, check for and install updates. This will likely require a reboot so ensure anything or anyone using it is shutdown or notified.

Improving the PowerShell ISE Experience with ISESteroids 2

For a long time I’ve used the built-in to Windows, PowerShell ISE for my PowerShell scripting experience. Most people tend to have a particular favourite editor for their coding, usually after trialling out a few different ones. For pretty much everything else I’ve settled on Sublime Text, but for PowerShell I use the ISE since I really like the integration with the PowerShell console. The ISE was introduced in PowerShell 2.

Delegating Permissions to vCO Workflows and Publishing for Consumption

I needed to look into the possibilities around granting delegated access to vCO workflows and ways to consume them without necessarily using the standard vCO client. The general idea was to have one group of people authoring workflows and another group consume some of them. vCO has the ability to delegate permissions to workflows and folders of workflows using users and groups; ideally you would have already setup vCO to use your AD for authentication so enabling this delegation via AD users and groups.

Automating Disk Zeroing on VM Deletion

A requirement for a project I had was to zero the VMDK of all VM disks at the time of VM removal. One consideration was to SSH into the host where the VM was located and use vmkfstools like the below on each vmdk to zero the disk. vmkfstools –w /vmfs/volumes/<…>.vmdk Looking for alternatives I found that the PowerCLI cmdlet Set-HardDisk has a ZeroOut parameter. Note the text from the help (version 5.

vFACTOR London VMUG January 2015

Ever thought about presenting at a user group, but not quite found that extra incentive to give it a go for the first time? Many people I know have benefited in both a personal and professional capacity from doing so and I certainly have too. The opportunity to relate tales of a project at work or a particular piece of technology you have an interest in can often be quite an experience I’ve found, with discussions afterwards leading to new ideas about your topic or even people believing you’re an expert at something, just because you had the guts good sense to stand up in front of your peers and talk about it.

Resource Action Object Not Correctly Passed Through to ASD Form in vCAC 6.0.x

When using the Advanced Service Designer to create Resource Actions it’s possible you may hit the following issue in vCAC 6.0.x if you attempt to access the Input Resource as part of the workflow Presentation. While everything will appear to work correctly in vCO, when the form is accessed by a vCAC user the Input Resource may not (I say *may* because the behaviour is inconsistent, sometimes it works, sometimes not!

Deploying a vShield Edge: "The virtual machine is not supported on the target datastore"

Content as string: Failed to publish configuration on vShield Edge. Failed to deploy edge appliance.10105The virtual machine is not supported on the target datastore.vShield Edge The API call was the second of two calls to deploy an Edge device into a vSphere Datacenter and Cluster, i.e. one Edge per datacenter, into a specified cluster. The first Edge was deployed successfully, but not the second. Both clusters were configured in a very similar manner, the only real difference being the name of the datacenter they belonged to.

Calling PowerShell.exe -Command ScriptName and Parameters with Commas

Bit of an obscure one this, but I hit it recently and wasted some time on it so I thought it might be useful for someone, somewhere, someday. If you need to call a PowerShell script via a command line style prompt (maybe in a scheduled task or an external system like vCenter Orchestrator) there are a number of different options. I was troubleshooting a problem where an existing system was failing with a command along the lines of this: