VMware Cloud Community
mpverr
Enthusiast
Enthusiast

Powershell - Obtaining properties of virtual machines

Greetings folks -

I've been playing around with powershell for VMware and am starting to get the hang of it. I was wondering if anyone had an example of powershell scripting that obtains the properties of the virtual machines. In particular, I was looking for things such as:

Disk break down and Size

Memory Assigned

MAC addresses

Many thanks

Tags (1)
0 Kudos
3 Replies
hugopeeters
Hot Shot
Hot Shot

Hi,

Try $a = Get-VM "TSTVM"

or $b = Get-VM "TSTVM" | Get-View

Use $a | Format-List *

or $b | Format-List *

to dig through all available properties.

0 Kudos
mpverr
Enthusiast
Enthusiast

Thanks for that info - would you happen to have an example script of being able to get the MAC address in powershell?

0 Kudos
halr9000
Commander
Commander

Read the help for the Get-NetworkAdapter cmdlet and you'll see it's really easy.






Author of the upcoming book: Managing VMware Infrastructure with PowerShell

Co-Host, PowerScripting Podcast (http://powerscripting.net)

My signature used to be pretty, but then the forum software broked it. vExpert. Microsoft MVP (Windows PowerShell). Author, Podcaster, Speaker. I'm @halr9000
0 Kudos