Created
January 24, 2016 19:16
-
-
Save anonymous/1219033be14200e25dbe to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$vm = Get-VM "vnname"| select name,VMHost | |
$hdd = Get-HardDisk -VM "vmname" -DiskType RawPhysical| select Parent, Name, Filename, SCSICanonicalName, DeviceName | |
$Lun = Get-SCSILun $hdd.SCSICanonicalName -VMHost $vm.vmhost | |
$lunpaths=$lun|Get-ScsiLunPath | |
$luns = $lunpaths | select name, sanid, State, Preferred | |
$luns | |
$props = @{'VMName' = $hdd.parent -join ';' | |
'HDDName' = $hdd.name -join ';' | |
'FileName' = $hdd.filename -join ';' | |
'DeviceName' = $hdd.devicename -join ':' | |
'CanonicalName' = $hdd.scsicanonicalname -join';' | |
'Luns' = $luns – join ';' (don't know if this makes sense :)) | |
or | |
'LunName' = $luns.name -join ';' | |
'SANId' = $luns.sanid -join ';' | |
'State' = $luns.sate -join ';' | |
'Preferred' = $luns.preferred -join';' | |
} | |
$obj = New-Object -TypeName PSObject -Property $props | |
#Write-Output $obj | |
$obj | Export-Csv vm.csv -NoTypeInformation |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment