PowerCLI Reference

New-CDDrive

Synopsis

This cmdlet creates a new virtual CD drive.

Syntax

New-CDDrive [-VM] <VirtualMachine> -ContentLibraryIso <ContentLibraryItem> [-Server <VIServer[]>] [-Confirm] [-WhatIf] [<CommonParameters>]

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

Related Commands

Online Version
Get-CDDrive
Remove-CDDrive
Set-CDDrive

Detailed Description

This cmdlet 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
VMVirtualMachineSpecifies the virtual machine to which the new virtual CD drive belongs. Passing multiple values to this parameter is obsolete.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
ContentLibraryIsoContentLibraryItemSpecifies the content library item of type ISO that you want to mount on the new CD drive.trueFalse
HostDeviceStringSpecifies 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
IsoPathStringSpecifies 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[]Specifies the vCenter Server systems on which you want to run the cmdlet. If no value is passed to this parameter, the command runs on the default servers. For more information about default servers, see the description of Connect-VIServer.falseFalse
StartConnectedSwitchParameterIndicates that the virtual CD drive starts connected when the virtual machine associated with it powers on.falseFalse
WhatIfSwitchParameterIndicates that the cmdlet is run only to display the changes that would be made and actually no objects are modified.falseFalse

Return Type

The one or more newly created CDDrive objects

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 © VMware, Inc. All rights reserved.