< Back

Set-CDDrive

Sun Jan 19, 2020 7:07 pm

NAME Set-CDDrive



SYNOPSIS

This cmdlet modifies the configuration of a virtual CD drive.





SYNTAX

Set-CDDrive [-CD] <CDDrive[]> [-Connected <Boolean>] [-HostDevice <String>] [-IsoPath <String>] [-NoMedia]

[-StartConnected <Boolean>] [-Confirm] [-WhatIf] [<CommonParameters>]





DESCRIPTION

This cmdlet updates a virtual CD drive. If an ISO location is provided, sets the CD to point to the ISO. Changes

the StartConnected and Connected flags if StartConnected and/or Connected is set. If NoMedia parameter is set to

$true, removes the CD drive's media backing and disconnects it. Note that the Connected parameter can be specified

only if the corresponding virtual machine is powered on.





PARAMETERS

-CD <CDDrive[]>

Specifies the virtual CD drive you want to configure.



Required? true

Position? 1

Default value None

Accept pipeline input? True (ByValue)

Accept wildcard characters? false



-Connected <Boolean>

Indicates that the virtual CD drive is connected after its creation. This parameter can be specified only if

the corresponding virtual machine is powered on.



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-HostDevice <String>

Specifies the path to the CD drive on the host which backs this virtual CD drive. Do not use this parameter

when the ISOPath and NoMedia parameters are specified.



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-IsoPath <String>

Specifies the datastore path to the ISO (CD image) file that backs the virtual CD drive. Do not use this

parameter when the HostDevice and NoMedia parameters are specified.



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-NoMedia [<SwitchParameter>]

Indicates that you want to detach from the CD drive any type of connected media - ISO from datastore or host

device. Do not use this parameter when the ISOPath or HostDevice parameters are specified.



Required? false

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



-StartConnected <Boolean>

Indicates that the virtual CD drive starts connected when the virtual machine associated with it powers on.



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-Confirm [<SwitchParameter>]

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



-WhatIf [<SwitchParameter>]

Indicates that the cmdlet is run only to display the changes that would be made and actually no objects are

modified.



Required? false

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).



INPUTS



OUTPUTS

Zero or more modified CDDrive objects







NOTES









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



$cd = New-CDDrive -VM VM -ISOPath "[sof-20666-esx:storage1] ISO\\testISO.iso"



Set-CDDrive -CD $cd -NoMedia



Creates a CD drive on the VM virtual machine and attaches testISO.iso, previously uploaded. Then disconnects the

ISO.



RELATED LINKS

Online Version: https://code.vmware.com/doc/preview?id= ... Drive.html

Get-CDDrive

New-CDDrive

Remove-CDDrive