Skip to content

Tag: PowerShell

Microsoft PowerShell

PowerShell 2

Investigating vCAC 5.2 Models

When you play with vCAC workflow and scripts you will most certainly work with the ManagementModelEntitesClient or the MgmtContext for short. Have a look at my introduction to it in this blog post. But there is actually more in vCAC than just that. Out of the box vCAC ships with these models: And some of them are actually quite useful. […]

PowerShell 0

Running a vCAC Workflow from PowerShell

Calling PowerShell from vCAC is easy, right. But how about the other way round? Suppose you want to start the ‘ReclaimDestroyedStaticIPAddresses’ or the ‘WFStubMachineExpired’ workflow manually? As usual this can be done via the vCAC MetaModel ODATA REST service and of course with PowerShell. For a brief overview about the MetaModel you can have a look at Investigating vCAC 5.2 […]

PowerShell 4

vCAC Provisioning without Guest Agent leaves Machine in ‘Installing OS’ state

When provisioning a server via PXE or ISO install you might run into a problem where you see your machines being in an ‘Installing OS’ state (between ‘BuildingMachine’ and ‘MachineProvisioned’) though the actual installation has finished long time ago. This might be because the ‘Guest Agent’ is either not installed on the image/machine or because there is no connectivity between […]

PowerShell 0

ServiceMesh AgilityPlatform: Login via PowerShell

Here is a quick script on how to login to ServiceMesh AgilityPlatform. Never heard of the product? don’t bother. It works nevertheless … Subsequent calls to AgilityPlatform are then execeuted like this (eg list all projects on the platform): An easy way to check if the login session is still valid is to issue the following request: You should receive […]

PowerShell 1

[NoBrainer] Convert IP address string into an [IPAddress] compatible constructor string

When you try to convert an ip address string into an [IPAddress] object you might end up with a different address than expected. This can happen if you use the ‘leading zero’ notation for IPv4 addresse (which is not really correct, but easier to sort alphabetically). When you create an [IPAddress] with that kind address style, the constructor does internally […]

PowerShell 0

Create vCAC ManagementModelEntites objects from ODATA REST call with PowerShell

As quickly described in a previous post, the ‘AddQueryOption()’ in the vCAC WCF DataService is flawed and does not allow you to narrow queries and thus leads to massive performance penalties when working with larger installations. However, there is a workaround for this: you can use native ODATA REST calls and convert the result into a native .NET vCAC ManagementModelEntities […]

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 6

[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 […]