Skip to content

Category: PowerShell

Microsoft PowerShell

PowerShell 3

Get Disk Capacity of a Virtual Machine in vCloud Director via PowerCLI

With the advent of PowerCLI for vCloud Director the reasons for using vCenter Orchestrator (vCO) blur even more. VMware provides us several CmdLets that we can all find in the “VMware.VimAutomation.Cloud” snapin (“Get-Command -Module VMware.VimAutomation.Cloud”). Sure this library is by far not perfect, there is quite some functionality. However, when using the “Get-CiVm” CmdLet you will probably find out quickly […]

PowerShell 1

[ordered] hashtable becomes hashtable when imported via Import-CliXml

The new powershell feature “ordered” hashtable (a new PowerShell feature in v3. See OrderedDictionary Class) becomes an ordinary hashtable when it is imported via Import-CliXml. There is a “active” bug on Microsoft Connect OrderedDictionary becomes Hashtable when exported to and imported from clixml but no action for a couple of months. As a workaround do not use ordered hashtables but […]

PowerShell 0

Design and Coding Considerations for PowerShell

Here a few coding considerations that might make you life easer when dealing with PowerShell (but may also hold true for other programming languages): Hide unwanted return information in your code In PowerShell your functions and CmdLets return everything that is output within the function – even if you use an explicit return statement. To avoid unwanted returns from there […]

PowerShell 2

Module: biz.dfch.PS.Storebox.Api

[UPDATE 2014-11-16] The module is now available on NuGet. See below for download link. [UPDATE 2014-10-13] I split the module into separate PS1 files (one per cmdlet/function) and created a manifest for it. Now you can use a prefix and change the name of the cmdlets (the default prefix is ‘Ctera’). Here you find the PowerShell module that you can […]

PowerShell 0

Module: biz.dfch.PS.ChargeBack.Api

Common This module utilises the .NET WebRequest class. ChargeBack API version information is defined in $biz_dfch_PS_ChargeBack_Api. Enter-ChargeBack Performs a login to a given vCenter ChargeBack server. Exit-ChargeBack Performs a logout from a given ChargeBack server. Invoke-ChargeBackCommand Invokes a specified ChargeBack command. With this CmdLet you can effectively issue any command against the ChargeBack API. Get-ChargeBackEntities (?) […]

PowerShell 2

Module: biz.dfch.PS.System.Logging

[UPDATE 2015-12-22] The module is now available on PowerShell Gallery. [UPDATE 2014-11-15] The module is now available on NuGet. This module allows you to have a unified logging in PowerShell and all your scripts. It depends on log4net and thus provides great flexibility on how and where you log. Basic usage is as follows: Main configuration is defined in the […]