PowerShell 0

biz.dfch.PS.System.Logging now supports log4net

I changed the way the biz.dfch.PS.System.Logging module implements its file writing by using log4net as the file logger. It makes use of the (static) FileAppender as the RollingFileAppender does not support concurrent access when rolling log files. So the log roll over is still handled within the PowerShell module directly (until I implement a custom lock for rolling the files […]

vCloud Automation Center 0

Using vCAC 5.2 with a CNAME

When you use vCAC with a CNAME and want to access the website /vCAC from the server itself you might actually notice that you can only access the website via “localhost” instead of the CNAME. This is actually a security feature of the Microsoft Internet Information Server that you can re-configure to adjust this behaviour. Just follow the artile You […]

PowerShell 1

Notifiying Users in vCAC via ‘Recent Events’

During long running provisionings you may want to inform the user about the states you are currently processing. In my previous blog post I showed how to add a text to the ‘CurrentTask’. But maybe you want to give the user a little bit more information where the status field does not provide enough space. Especially in case of a […]

PowerShell 1

Decrypting Passwords in vCAC ConnectionCredentials

Suppose you provision a virtual machine to a vCenter and then want to change the socket/core ratio of that machine as described in vCloud Automation Center – vCAC – Workflow and Script to Change CPU’s to Cores. For this to actually work you not only need the vCenter address but also some valid credentials you can use to connect to […]

PowerShell 0

Resolve and Determine vCAC Machine Type

Here is a way how to quickly determine the machine type to be deployed without resorting to the ‘VirtualMachineExt’ object (which by the way is not yet available in the ‘BuildingMachine’ state): In case you wonder what other machine types exist you can check the enumeration like this: Though this can easily be achieved in a different manner, the point […]

PowerShell 0

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 accompanying MSDN documentation for WriteAttributeString() […]

PowerShell 0

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 this seems that the security […]

PowerShell 0

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 2” parameter). As this article […]