The New-VIProperty cmdlet, that was introduced with PowerCLI 4.1, offers endless possibilities to add new properties to any PowerCLI object.

For an overview of what you can do with the New-VIProperty cmdlet have a look at my PowerCLI 4.1 brings the New-VIProperty cmdlet post.

I created this page to collect useful code blocks and extension properties that can be used with the new cmdlet.

Since August 17th 2011 all the New-VIProperty entries from this page are now also available as a module. For the installation instructions see the VIProperties in a Module post.

VIProperty 140625
VIProperty 140625
VIProperty_140625.zip
3.3 KiB
Details...

Feel free to forward me your New-VIProperty statements and I will include them in the list.


Cluster

NumberOfHosts

NumberOfVMs

NumberVmotions

Credit: Maish Saidel-Keesing

NumCPU

Credit: Alan Renouf

NumPoweredOnvCPUs

Credit: Alan Renouf

NumvCPUs

Credit: Alan Renouf

Datastore

CapacityGB

FreeGB

NumberOfVMs

Credit: Robert van den Nieuwendijk

PercentFree

Credit: Sean Duffy

ProvisionedGB

Harddisk

Datastore

UnitNumber

PhysicalNic

LinkState

Portgroup

vCenterServer

ScsiController

Harddisk

ScsiLun

lunDatastoreName

lunID

quot; `
-InputObject $lun.RuntimeName).Matches[0].Groups[‘lunID’].Value
} -Force

Snapshot

Datacenter

Credit: Alan Renouf

DaysOld

Credit: Alan Renouf

vCenter

Credit: Alan Renouf

VirtualMachine

BootDelay

BootTime

Credit: Robert van den Nieuwendijk

CBTEnabled

Credit: Alan Renouf

CpuHotAddEnabled

Credit: Hal Rottenberg

DNSname

Credit: Jonathan Medd

MemoryHotAddEnabled

Credit: Hal Rottenberg

MemReservation

Credit: Alan Renouf

NumVirtualDisks

Credit: Alan Renouf

OSName

Credit: Jonathan Medd

SnapshotSpaceUsed

Ignore the warning about the ‘$_’ variable

ToolsVersion

Credit: Carter Shanklin

ToolsVersionStatus

Credit: Hal Rottenberg

vCenterServer

Credit: Robert van den Nieuwendijk

VMCluster

Credit: Stevie.R

VMIenabled

VmxDatastoreFullPath

Credit: Hal Rottenberg

WebShortcut URL

Credit API 4 part: Robert van den Nieuwendijk
API 5 part: me

YellowFolderName

YellowFolderName (recursive)

Sample of a recursive function.

VMHost

AvgCPUUsage24Hr

Credit: Hal Rottenberg

ClusterName

Credit: Jonathan Medd

Hardware

MemoryTotalGB

Credit: Jonathan Medd

Number of powered on guests

Credit: FillDeeUK

NumberOfVMs

Credit: Carter Shanklin

NumPoweredOnvCPUs

Credit: Alan Renouf

NumvCPUs

Credit: Alan Renouf