$esxName = "ESX Name"
$tmp = @()
Get-VMHost -Name $esxName | Get-Datastore |
Where-Object {$_.ExtensionData.Info.GetType().Name -eq "VmfsDatastoreInfo"} |
ForEach-Object {
if ($_)
{
$Datastore = $_
$tmp += $Datastore.ExtensionData.Info.Vmfs.Extent | Select-Object -Property @{Name="Name";Expression={$Datastore.Name}},DiskName
}
}
$tmp | export-csv -NotypeInformation diskinfo.csv
$tmp = @()
Get-VMHost -Name $esxName | Get-Datastore |
Where-Object {$_.ExtensionData.Info.GetType().Name -eq "VmfsDatastoreInfo"} |
ForEach-Object {
if ($_)
{
$Datastore = $_
$tmp += $Datastore.ExtensionData.Info.Vmfs.Extent | Select-Object -Property @{Name="Name";Expression={$Datastore.Name}},DiskName
}
}
$tmp | export-csv -NotypeInformation diskinfo.csv
No comments:
Post a Comment