Difference between revisions of "Useful One-Liners (PowerCLI)"

Jump to navigation Jump to search
→‎Storage: Added "List VM RDMs" and "Datastore MultiPathing Policy"
(Move of content from original PowerCLI/VIToolkit page)
 
(→‎Storage: Added "List VM RDMs" and "Datastore MultiPathing Policy")
Line 118: Line 118:
<source lang="powershell"> Copy-DatastoreItem C:\Temp\FileToUpload.vmdk -Destination DS:\VMFolder\ </source>  
<source lang="powershell"> Copy-DatastoreItem C:\Temp\FileToUpload.vmdk -Destination DS:\VMFolder\ </source>  


=== List VM RDMs ===
List VM Raw Device Mapping (RDM) disks
<source lang="powershell"> Get-VM | Get-HardDisk -DiskType "RawPhysical","RawVirtual" | Select Parent,Name,CapacityKB,Filename,ScsiCanonicalName,DeviceName </source>
=== List LUN Multipathing ===
List all disk multipathing
<source lang="powershell"> Get-VMHost | Get-ScsiLun | Select VMHost,Vendor,Model,LunType,CapacityMB,RuntimeName,MultipathPolicy,CanonicalName | Export-Csv lunpath.csv </source>


[[Category:PowerCLI]]
[[Category:PowerCLI]]

Navigation menu