VMware Cloud Community
bcetinich
Contributor
Contributor
Jump to solution

Reporting based on blue folder

I want to get a list of all VMs within a certain blue folder and also list each VMs disk sizes for each disk

Does anyone have anything in their code safe that could help me out

Reply
0 Kudos
1 Solution

Accepted Solutions
LucD
Leadership
Leadership
Jump to solution

Is this producing what you are looking for ?

$folder = <folder-name>
$report = @()
Get-Folder $folder | Get-VM | % {
	foreach($disk in $_.HardDisks){
		$row = "" | Select VMName, Disk, DiskCapacity
		$row.VMName = $_.Name
		$row.Disk = $disk.Name
		$row.DiskCapacity = $disk.CapacityKB
		$report += $row
	}
}
$report


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

View solution in original post

Reply
0 Kudos
1 Reply
LucD
Leadership
Leadership
Jump to solution

Is this producing what you are looking for ?

$folder = <folder-name>
$report = @()
Get-Folder $folder | Get-VM | % {
	foreach($disk in $_.HardDisks){
		$row = "" | Select VMName, Disk, DiskCapacity
		$row.VMName = $_.Name
		$row.Disk = $disk.Name
		$row.DiskCapacity = $disk.CapacityKB
		$report += $row
	}
}
$report


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

Reply
0 Kudos