編輯

共用方式為


Set-VMDvdDrive

Configures a virtual DVD drive.

Syntax

Set-VMDvdDrive
   [-CimSession <CimSession[]>]
   [-ComputerName <String[]>]
   [-Credential <PSCredential[]>]
   [-VMName] <String>
   [[-ControllerNumber] <Int32>]
   [[-ControllerLocation] <Int32>]
   [-ToControllerNumber <Int32>]
   [-ToControllerLocation <Int32>]
   [[-Path] <String>]
   [-ResourcePoolName <String>]
   [-AllowUnverifiedPaths]
   [-Passthru]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
Set-VMDvdDrive
   [-VMDvdDrive] <DvdDrive[]>
   [-ToControllerNumber <Int32>]
   [-ToControllerLocation <Int32>]
   [[-Path] <String>]
   [-ResourcePoolName <String>]
   [-AllowUnverifiedPaths]
   [-Passthru]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]

Description

The Set-VMDvdDrive cmdlet configures the controller and location of a virtual DVD drive.

Examples

Example 1

Set-VMDvdDrive -VMName TestVM -Path .\WinBuild.iso

Configures the virtual DVD drive of virtual machine TestVM to use WinBuild.iso as its media.

Example 2

Set-VMDvdDrive -VMName TestVM -ControllerNumber 1 -ControllerLocation 0 -Path $null

Configures the virtual DVD drive at IDE 1,0 of virtual machine TestVM to use no media. (This ejects any existing media from the virtual DVD drive.)

Example 3

Get-VMDvdDrive -VMName TestVM -ControllerNumber 1 -ControllerLocation 0 | Set-VMDvdDrive -ToControllerLocation 1

Moves virtual DVD drive from IDE 1,0 to IDE 1,1 on virtual machine TestVM.

Parameters

-AllowUnverifiedPaths

Specifies that no error is to be thrown if the specified path is not verified as accessible by the cluster. This parameter is applicable to clustered virtual machines.

Type:SwitchParameter
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-CimSession

Runs the cmdlet in a remote session or on a remote computer. Enter a computer name or a session object, such as the output of a New-CimSession or Get-CimSession cmdlet. The default is the current session on the local computer.

Type:CimSession[]
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-ComputerName

Specifies one or more Hyper-V hosts on which the DVD drive is to be configured. NetBIOS names, IP addresses, and fully qualified domain names are allowable. The default is the local computer. Use localhost or a dot (.) to specify the local computer explicitly.

Type:String[]
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Confirm

Prompts you for confirmation before running the cmdlet.

Type:SwitchParameter
Aliases:cf
Position:Named
Default value:False
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-ControllerLocation

Specifies the IDE controller location of the DVD drives to be configured. If not specified, DVD drives in all controller locations are configured.

Type:Int32
Position:2
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-ControllerNumber

Specifies the IDE controller of the DVD drives to be configured. If not specified, DVD drives attached to all controllers are configured.

Type:Int32
Position:1
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Credential

Specifies one or more user accounts that have permission to perform this action. The default is the current user.

Type:PSCredential[]
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Passthru

Specifies that a Microsoft.HyperV.PowerShell.DvdDrive object is to be passed through to the pipeline representing the virtual DVD drive to be configured.

Type:SwitchParameter
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Path

Specifies the path to the ISO file or physical DVD drive that will serve as media for the virtual DVD drive.

Type:String
Position:3
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-ResourcePoolName

Specifies the friendly name of the ISO resource pool to which this DVD drive is to be associated.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-ToControllerLocation

Specifies the controller location to which this virtual DVD drive should be moved.

Type:Int32
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-ToControllerNumber

Specifies the controller number to which this VMDvdDrive should be moved.

Type:Int32
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-VMDvdDrive

Specifies the virtual DVD drive to be configured.

Type:DvdDrive[]
Position:0
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-VMName

Specifies the name of the virtual machine on which the DVD drive is to be configured.

Type:String
Position:0
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Type:SwitchParameter
Aliases:wi
Position:Named
Default value:False
Required:False
Accept pipeline input:False
Accept wildcard characters:False

Outputs

None

Default

Microsoft.HyperV.PowerShell.DvdDrive

If -PassThru is specified.