Browsed by
Category: Powershell

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

Collecting from ESX/ESXi with VMware vCM 5.4

Collecting from ESX/ESXi with VMware vCM 5.4

If you have VMware vCM (Configuresoft ECM, EMC Ionix SCM) and want to collect from ESX/ESXi you have to create a local user on the ESXi host and give that user Administrator permissions. That can be quite a daunting task if you have more than a handful of machines so I wrote the below powershell program that allows interactive use or automated use with a .CSV file. —Start ScriptFunction NextUser { if ($newUser) { Write-host “Do you want to specify…

Read More Read More