Setting XML namespaces in XmlTextWriter correctly

Using [System.Xml.XmlTextWriter] in combination with [System.IO.StringWriter] you can easily create an arbitrary large XML document in memory on the fly. Creating and closing elements and attributes comes down to a simple pair of WriteStartelement()/WriteEndelement() and WriteAttributeString(). However when you want to create namespaces in your XML document things get a little bit trickier as the […]

Setting ‘null’ values on vCAC entity properties with PowerShell

When using the vCAC mgmtContext you can get and set any exposed property in the repository. When I recently used that to set the “CurrentTask” property of a VirtualMachine object I noticed that the initial value of the property was “null” but when I wrote a PowerShell ‘$null’ value into it to reset it to […]

vCO PowerShell Plugin: Import-CliXml fails with System.Security.Cryptography.CryptographicException

When using the PowerShell plugin for vCenter Orchestrator (vCO) you might receive a ‘System.Security.Cryptography.CryptographicException’ exception when using ‘Import-CliXml’ with a PSCredential object. Furthermore, you might get the message: ‘The requested operation cannot be completed. The computer must be trusted for delegation and the current user account must be configured to allow delegation’. The reason behind […]

vCAC: Provision a Virtual Machine Blueprint from PowerShell

Order Virtual Machine

Despite VMware’s efforts to make vCAC look more appealing our customers still like a GUI that actually looks as if it was from this century. And it is really no problem to build something like the Telerik Kendo based ‘Self Service Portal’ (the one that will sadly be replaced by something in else in the […]

vCAC: Using the .NET ODATA REST Client from PowerShell

As you know vCAC provides a REST interface for its repository that you can use to manipulate most of its entities. Although the calling convention for this (ODATA based) REST interface is quite clear and among others Tom provided a few hints and some sample scripts on how to query things it is quite a […]

vCAC: Dynamically load properties in PowerShell for vCAC entities

I recently wrote about on how to use the mgmtContext from vCAC so that you can use it outside the script/file repository of vCAC. With it you can easily access VirtualMachines, GlobalProperties without the need to use the ODATA REST interface of vCAC. However, when you first grab a virtual machine you might have wondered […]

Updated vCAC Plugin for vCO

vCAC Inventory View

Yesterday I opened a Service Request at VMware because I had problems registering a vCAC host within vCO. The error (again) was related to SSL certifcate issues and that the vCO server (or its Java engine, to be more precise) would not want to accept the certificate from the vCAC host. So when I called […]

Programmatic way to get valid values for a Cmdlet parameter

Recently I needed a programmatic way to check valid arguments for a Cmdlet that were defined by a “ValidateSet”. I came across the article from Jeffrey Snover “Programmatic way to get valid string values for a parameter” but the mechanism did not seem to work (unless you start PowerShell with the “-Version 1” or “-Version […]

Investigating the vCAC 5.2 mgmtContext

vCAC Workflow Designer mgmtContext

[UPDATE 2014-02-16] For an introduction of vCAC other models have have a look at Investigating vCAC 5.2 Models. One of the cool features of vCAC is the ability to hook into the various steps of the provisioning process via scripting – especially with Windows PowerShell. As vCAC is built on top of ,NET it is […]