vSphere PowerCLI Reference

New-CDDrive

Synopsis

Creates a new virtual CD drive.

Syntax

New-CDDrive [-IsoPath <String>] [-HostDevice <String>] [-StartConnected] [-VM] <VirtualMachine[]> [-Server <VIServer[]>] [-WhatIf] [-Confirm] [<CommonParameters>]

Related Commands

Online version
Get-CDDrive
Remove-CDDrive
Set-CDDrive

Detailed Description

Creates a new virtual CD drive for each of the provided virtual machines. If an ISO location is provided, sets the CD to point to the ISO.

Parameters

NameTypeDescriptionRequired?Pipeline InputDefault Value
VMVirtualMachine[]Specify the virtual machine to which the new virtual CD drive belongs.truetrue (ByValue)
ConfirmSwitchParameterIf 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.falsefalse$true
HostDeviceStringSpecify the path to the CD drive on the virtual machine host that backs the virtual CD drive. Do not set this parameter if the ISOPath parameter is set.falsefalse
IsoPathStringSpecify the datastore path to the ISO (CD image) file that backs the virtual CD drive. Do not set this parameter if the HostDevice parameter is set.falsefalse
ServerVIServer[]Specify the vSphere servers on which you want to run the cmdlet. If no value is given to this parameter, the command runs on the default servers. For more information about default servers, see the description of Connect-VIServer.falsefalse
StartConnectedSwitchParameterIndicate that the virtual CD drive starts connected when the virtual machine associated with it powers on.falsefalse
WhatIfSwitchParameterIndicate that the cmdlet is run only to display the changes that would be made and actually no objects are modified.falsefalse

Return Type

CDDrive

Notes

Examples

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

New-CDDrive -VM $vm -ISOPath "Path_to_ISO\test.iso"

Creates a CD drive on the specified virtual machine and attach an ISO image to it.


Copyright © 1998 - 2012 VMware, Inc. All rights reserved.