I am just starting to learn powershell so be patient! I'm looking for a way to connect to our VC or one of the hosts and list all of the virtual servers and their individual drive capacities and also the freespace for each drive. I just started playing around with powershell yesterday and found that if I do "get-vm|fc" it will list out alot of detail about each virtual machine including some lines like below. As far as getting the drive listings for each vm with capacity and freespaceinto a nice formatted report, I'm at a loss. Anyone wanna help? I'm looking through some other scripts to get examples but thought I'd through this out there and see if anyone else (who has better powershell skills!) could help out some.
class VirtualMachineImpl
{
PowerState = PoweredOn
Description =
Guest =
class VMGuestImpl
{
OSFullName = Microsoft Windows Server 2003, Standard Edition (32-bit
IPAddress =
[
REMOVED
]
State = Running
Disks =
[
class DiskInfoImpl
{
Path = C:\
Capacity = 8578932736
FreeSpace = 1092395008
}
class DiskInfoImpl
{
Path = D:\
Capacity = 10733219840
FreeSpace = 10666061824
}
]
Tags:
get-view,
powershell,
script,
storage,
vm