4 awesome PowerCLI Commands

Here are some useful PowerCLI Commands:

#Get all VirtualPortGroups and Loadbalance Policy
Get-VirtualPortGroup | ft Name, @{Label=”LoadbalancingPolicy”; Expression = { $_.ExtensionData.config.defaultportconfig.uplinkteamingpolicy.policy.value}}

#Get all VirtualPortGroups which are not IP-Hash
Get-VirtualPortGroup | ? { $_.ExtensionData.config.defaultportconfig.uplinkteamingpolicy.policy.value -ne “loadbalance_ip” }

#Get all VMs with CDROM attached
Get-VM | FT Name, @{Label=”ISOfile”; Expression = { ($_ | Get-CDDrive).ISOPath }}

#Get all VMs with Snapshots
Foreach($vm in get-vm){ get-snapshot $vm |select VM,Name,Description,Created}

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s