Skip to content

Month: December 2013

PowerShell 2

[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. All you have to do […]

PowerShell 7

[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 you will find plenty of […]

PowerShell 0

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 aforementioned properties (that are actually […]