Difference between revisions of "Script Extracts and Examples (PowerCLI)"

Jump to navigation Jump to search
→‎Storage: Added upload to datastore
(→‎Script Extracts: Added "VM Storage Usage" and "ESX CDP Info")
(→‎Storage: Added upload to datastore)
Line 172: Line 172:
| <code> get-vm -Location (Get-Folder -Name "MyFolder") <nowiki>|</nowiki> get-harddisk <nowiki>|</nowiki> sort-object -Property Filename </code>  
| <code> get-vm -Location (Get-Folder -Name "MyFolder") <nowiki>|</nowiki> get-harddisk <nowiki>|</nowiki> sort-object -Property Filename </code>  
| Get the vHD details for all VM’s in a folder (sorted by VMDK path)
| Get the vHD details for all VM’s in a folder (sorted by VMDK path)
|-
| <code> New-PSDrive -Name DS -PSProvider ViMdatastore -Root '\' -location (Get-Datastore MyDatastore) </code>
| Create a PowerShell drive for the ''MyDatastore'' datastore
|-
| <code> Copy-DatastoreItem C:\Temp\FileToUpload.vmdk -Destination DS:\VMFolder\ </code>
| Upload file to datastore (a PowerShell drive needs to be create 1st - see above)
|}
|}


Navigation menu