Browsed by
Category: PowerCLI

Writing PowerCLI for Performance

Writing PowerCLI for Performance

I was building a piece of PowerCLU code to check on my vCD Deployed vAPPs for certain errors and because it’s me I was curious what performance difference there was between using array based operations verses piped operations in powershell. Here’s what I found out. Here is the array based operation – time to completion 2 minutes 30 seconds. $myVAPP = @(Get-CIVApp | Select-Object Org, Name, Status)        foreach ($myVAPP.Name in $myVAPP)            {                IF ($myVAPP.Status -eq “FailedCreation”)                     {                        Write-Host ‘vAPP’…

Read More Read More

How to find where a VM is hosted

How to find where a VM is hosted

A fairly common problem is if you know a machine is virtual but you don’t know where it is hosted. A perfect example is if you get notified that a machine in your environment has a virus and needs powered off but nobody knows where the machine is hosted. This gets even more interesting when you have nested virtual ESX hosts with guests running under them. With a quick google search I found 2 PowerCLI scripts that got close to…

Read More Read More