powershellscripts.com

Tutorials  PowerShell Cmdlet Help for Copy-HardDisk



NAME
Copy-HardDisk

SYNOPSIS
Copies a virtual hard disk to another destination.

SYNTAX
Copy-HardDisk [-HardDisk] [-DestinationPath] [-DestinationStorageFormat rmat>] [-Force] [-RunAsync] [-WhatIf] [-Confirm] []


DESCRIPTION
Copies a virtual hard disk to another destination specified by the DestinationPath parameter. DestinationPath must
be a datastore path to the destination folder.


PARAMETERS
-HardDisk
Specify the virtual hard disk you want to copy.

Required? true
Position? 2
Default value
Accept pipeline input? true (ByValue)
Accept wildcard characters? false

-DestinationPath
Specify the datastore path to the folder where you want to copy the hard disk. The datastore name is included i
n the path in square braces.

Required? true
Position? 1
Default value
Accept pipeline input? false
Accept wildcard characters? false

-DestinationStorageFormat
Specify the type of the hard disk copied on the new location. The valid values are Thin, Thick, Thin2GB, and Th
ick2GB.

Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false

-Force
Indicate whether to overwrite all disks with the same name at the provided destination.

Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false

-RunAsync
Indicate that the command returns immediately without waiting for the task to complete. In this mode, the outpu
t of the cmdlet is a Task object. For more information about the -RunAsync parameter run " help About_RunAsync"
in the vSphere PowerCLI console.

Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false

-WhatIf
Indicate that the cmdlet is run only to display the changes that would be made and actually no objects are modi
fied.

Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false

-Confirm
If the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false,
the cmdlet runs without asking for user confirmation.

Required? false
Position? named
Default value $true
Accept pipeline input? false
Accept wildcard characters? false


This cmdlet supports the common parameters: Verbose, Debug,
ErrorAction, ErrorVariable, WarningAction, WarningVariable,
OutBuffer and OutVariable. For more information, type,
"get-help about_commonparameters".

INPUTS



OUTPUTS
HardDisk


NOTES


Supported only on ESX 4.0 and later.

-------------- Example 1 --------------

C:\PS>Get-HardDisk -VM $vm | Copy-HardDisk "[Storage1]/"


Retrieves the hard disks of a virtual machine and copies them into the storage1 root folder.





-------------- Example 2 --------------

C:\PS>Copy-HardDisk -HardDisk $hdd -DestinationPath "[Storage1] vms/disks" -DestinationStorageFormat Thick


Copies the $hdd hard disk to the "vms/disks"location on storage1 and changes the storage format of the destination
disk to Thick.






RELATED LINKS
Online version: http://www.vmware.com/support/developer/PowerCLI/PowerCLI501/html/Copy-HardDisk.html
Get-HardDisk
New-HardDisk
Remove-HardDisk
Set-HardDisk