Sdílet prostřednictvím


Remove-SCVirtualDVDDrive

Removes a virtual DVD drive object from VMM.

Syntax

VirtualDVDDriveSpecified

Remove-SCVirtualDVDDrive
    [-VirtualDVDDrive] <VirtualDVDDrive>
    [-JobGroup <Guid>]
    [-RunAsynchronously]
    [-PROTipID <Guid>]
    [-JobVariable <String>]
    [-WhatIf]
    [-Confirm]
    [-OnBehalfOfUser <String>]
    [-OnBehalfOfUserRole <UserRole>]
    [<CommonParameters>]

SourceBusAndLunSpecified

Remove-SCVirtualDVDDrive
    -SourceBus <Byte>
    -SourceLUN <Byte>
    -JobGroup <Guid>
    [-RunAsynchronously]
    [-PROTipID <Guid>]
    [-JobVariable <String>]
    [-WhatIf]
    [-Confirm]
    [-OnBehalfOfUser <String>]
    [-OnBehalfOfUserRole <UserRole>]
    [<CommonParameters>]

Description

The Remove-SCVirtualDVDDrive cmdlet removes one or more virtual DVD drive objects from a hardware profile, a virtual machine, or a virtual machine template used in a Virtual Machine Manager (VMM) environment. The cmdlet also deletes any .iso file that the virtual DVD drive uses from the file system on the library server.

This cmdlet returns the object upon success (with the property MarkedForDeletion set to True) or returns an error message upon failure.

Examples

Example 1: Remove a specific virtual DVD drive from a virtual machine

PS C:\> $VM = Get-SCVirtualMachine -Name "VM01"
PS C:\> $DVDDrive = Get-SCVirtualDVDDrive -VM $VM | where { $_.Bus -eq 1 -and $_.LUN -eq 0 }
PS C:\> Remove-SCVirtualDVDDrive -VirtualDVDDrive $DVDDrive

The first command gets the virtual machine object named VM01 and stores the object in the $VM variable.

The second command gets the virtual DVD drive object located on the first slot of the Secondary Channel (specified by -Bus 1 and -LUN 0) on the IDE bus on VM01 and then stores the virtual DVD drive object in the $DVDDrive variable.

The last command removes the virtual DVD drive object stored in $DVDDrive from VM01 and deletes any .iso file that this virtual DVD drive uses from the file system on the library server.

Example 2: Remove the third virtual DVD drive from a virtual machine

PS C:\> $VM = Get-SCVirtualMachine -Name "VM02"
PS C:\> $DVDDrive = Get-SCVirtualDVDDrive -VM $VM
PS C:\> $DVDDrive[2] | Remove-SCVirtualDVDDrive

The first command gets the virtual machine object named VM02 and stores the object in the $VM variable.

The second command gets all virtual DVD drive objects connected to VM02 and stores each virtual DVD drive object in the $DVDDrive object array. This example assumes that VM02 has three virtual DVD drives and therefore the array contains three elements (counting 0 to 2).

The last command passes the third virtual DVD drive (object [2]) stored in $DVDDrive to the Remove-SCVirtualDVDDrive cmdlet, which removes this virtual DVD drive object from VM02 and deletes any .iso file used by this virtual DVD drive from the file system on the library server.

Parameters

-Confirm

Prompts you for confirmation before running the cmdlet.

Parameter properties

Type:SwitchParameter
Default value:False
Supports wildcards:False
DontShow:False
Aliases:cf

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-JobGroup

Specifies an identifier for a series of commands that will run as a set just before the final command that includes the same job group identifier runs.

Parameter properties

Type:Guid
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

VirtualDVDDriveSpecified
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-JobVariable

Specifies that job progress is tracked and stored in the variable named by this parameter.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-OnBehalfOfUser

Specifies a user name. This cmdlet operates on behalf of the user that this parameter specifies.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-OnBehalfOfUserRole

Specifies a user role. To obtain a user role, use the Get-SCUserRole cmdlet. This cmdlet operates on behalf of the user role that this parameter specifies.

Parameter properties

Type:UserRole
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-PROTipID

Specifies the ID of the Performance and Resource Optimization tip (PRO tip) that triggered this action. This parameter lets you audit PRO tips.

Parameter properties

Type:Guid
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-RunAsynchronously

Indicates that the job runs asynchronously so that control returns to the command shell immediately.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-SourceBus

Specifies the source IDE bus for the drive.

Parameter properties

Type:Byte
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

SourceBusAndLunSpecified
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-SourceLUN

Specifies the source logical unit number (LUN) for a virtual DVD drive object on an IDE bus.

Parameter properties

Type:Byte
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

SourceBusAndLunSpecified
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-VirtualDVDDrive

Specifies a virtual DVD drive object.

Parameter properties

Type:VirtualDVDDrive
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

VirtualDVDDriveSpecified
Position:0
Mandatory:True
Value from pipeline:True
Value from pipeline by property name:False
Value from remaining arguments:False

-WhatIf

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

Parameter properties

Type:SwitchParameter
Default value:False
Supports wildcards:False
DontShow:False
Aliases:wi

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

Notes

  • Requires a VMM virtual DVD drive object, which can be retrieved by using the Get-SCVirtualDVDDrive cmdlet.