[NoBrainer] PowerShell Write-Progress wrapper

Nested Write-Progress bars

Sometimes I have to write scripts that are executed interactively and actually watched by operators as they progress – I know this sounds strange enough. In these rare cases I like to use something like Write-Progress as the poor operator might not want to scroll through endless lines of logs but just wants to literally […]

[NoBrainer] Use splatting to simplify Cmdlet development

When rolling your own Cmdlets you will probably want to expand your module over time possibly adding or editing functions. I order to keep your Cmdlet as a function and not having to reload the module on every code change you can use Splatting (which requires at least PowerShell v3) to simplify developement and debugging. […]

[NoBrainer] SSL connection error when using PowerShell

When using https request (directly or indirectly) with PowerShell you might run into different errors when using non-standard (i.e. not trusted, expired, self-signed etc) certificates: The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel. The underlying connection was closed: An unexpected error occurred on a send. In either case […]

Finally: vCO Interactive Shell

vCO CLI

I totally missed that! So my surprise was even bigger: vCO now has an interactive Shell (vCO-Cli) just like Python and PowerShell. Ok, maybe not really like them; but at least major step towards some much more usable environment. Now you can actually test code without starting a complete workflow everything going through this painful […]

Housekeeping the vCAC MgmtContext

When working with the vCAC MgmtContext from within PowerShell or whatever other .NET language you will probably have noticed two properies on the context called ‘Entities’ and ‘Links’. Whenever you make a call like ‘$vm = m.VirtualMachines |? VirtualMachineName -eq “server1″‘ the DataContext is tracking the queries objects and thus adding them to the two […]

vCAC: Dynamically execute Scripts in ExternalWFStubs Workflows with PowerShell

Property Definitions for executing custom scripts

Often you would like to customise one or two things with a script in one of the predefined workflow steps like ‘BuildingMachine’. However depending on your blueprint you do not neccessarily want to execute all of the scripts all time. Having some more dynamic selection would come in handy. This can be easily done with […]

vCAC: Export all PropertyDefinitions automatically with PowerShell

Imagine you feel like reinstalling your vCAC system as the DB got somehow corrupted and VMware support is not able to fix it. Although you really like the fancy GUI of the vCAC administration interface you somehow get bored to enter all your configuration options again and again … As usual, there is help: You […]

vCAC: Displaying Available Networks per Location using PowerShell

Sometimes you want to have the user to be able to select a VLAN based on the location he chooses during a machine request. With some little logic you can actually create a DropDown box backed by a ValueExpression that lists all selected networks per location. You only have to enumerate all HostReservations, lookup the […]