How to add the Cluster name to the report

Get-data center $DC | Get-Datastore. Where-Object {$_.} {Name - notlike "DataStore1 *"} |

Sort-Object-property name.

Select-Object - property name,

@{Name = "CapacityGB"; Expression = {[Math]: tour ($_.)} (CapacityGB, 0)}},

@{Name = "UsedSpaceGB"; Expression = {[Math]: tour ($_.)} CapacityGB-$_. (FreeSpaceGB, 0)}},

@{Name = "FreeSpaceGB"; Expression = {[Math]: tour ($_.)} (FreeSpaceGB, 0)}},

@{Name = "UncommittedSpaceGB"; Expression = {}

If (-not $_.) ExtensionData.Summary.Uncommitted) {}

0

}

else {}

[Math]: tour ($_.) ExtensionData.Summary.Uncommitted/1GB,0)

}

}},

@{Name = "ProvisionedSpaceGB"; Expression = {}

$Summary = $_. ExtensionData.Summary

If (-not of $Summary.Uncommitted) {}

[Math]: round (($Summary.Capacity-$Summary.FreeSpace)/1GB,0)

}

else {}

[Math]: round (($Summary.Capacity-$Summary.FreeSpace + $Summary.Uncommitted) / 1 GB, 0)

}

}},

@{Name = "PercentageUsed"; Expression = {[Math]: round (100 *($_.)} CapacityGB-$_. FreeSpaceGB) / $_. (CapacityGB, 0)}},

@{Name = "PercentageFreeSpace"; Expression = {[Math]: round (100 * $_.)} FreeSpaceGB / $_. (CapacityGB, 0)}},

@{Name = "PercentageProvisioned"; Expression = {}

$Summary = $_. ExtensionData.Summary

If (-not of $Summary.Uncommitted) {}

[Math]: round (100 * ($Summary.Capacity-$Summary.FreeSpace)/$Summary.Capacity,0))

}

else {}

[Math]: round (100 * ($Summary.Capacity - $Summary.FreeSpace + $Summary.Uncommitted)/$Summary.Capacity,0))

}

}},

@{Name = 'MV'; Expression = {[string]: join (';', ($_.))} ExtensionData.Vm | ForEach-Object {Get-View-Id $_}). Name)}}.

@{Name = "VMDK"; Expression = {[string]: Join (';', (& {}}

$Datastore = $_

$Datastore.ExtensionData.Vm |

{ForEach-Object

Notice-EEG-Id $_.

Get-VIObjectByVIView |

Get-hard drive |

Where-Object {$_.} FileName-like "* $($Datastore.Name) *"} ".

}

}). File name)

}} | Export-CSV $FileName - NoTypeInformation - UseCulture

Try adding this calculated property

@{N = 'Cluster'; E = {Get-VMHost - Datastore $_______ |} Get-Random | Get-Cluster | {{Select - ExpandProperty name}}.

Tags: VMware

Similar Questions

Maybe you are looking for

  • Help please! Computer does not recognize Iphone

    Can someone help me please?  I connected my iPhone to my laptop to use iTunes.  My device screen of trust and I hit accidentally do not trust! Now I can't get my computer to recognize it as all. I looked online and it says that I have to reset my who

  • Change the size of the window

    Hello I created a VI using LV8.0... When I run that in my computer screen size is OK. But when I try to run the VI on other computers and laptops, screen size is smaller, window of my VI fits on the screen... I'm unable to see all the controls and in

  • henrid

    I was struck by a virus ' PUA / SearchProtect.GEN. This has changed all my settings in the USA. I changed some of them to the Canada. Not sure if I got all of that. Then I got a message on my window saying "Windows 7 Build 7601, this copy of Windows

  • BlackBerry Z10 two issues I am

    Hey, I am having two problems. First problem is that I have a notification text message (which I have installed text alerts for my bank account) in my hub, i.e. for an SMS of Scotiabank. I opened the message and it is not clear and I tried to delete

  • Unhandled exception occurred

    Unhandled exception has occurred in your application. If you click on continue the application will ignore this error and attempt to continue. If you click on exit, the application closes immediately. Input string was not in the correct format. . See