Disconnect-VirtualDisk
Disconnects a virtual disk from the specified computer, revoking access to the virtual disk.
Syntax
Disconnect-VirtualDisk
[-FriendlyName] <String[]>
[-AsJob]
[-CimSession <CimSession[]>]
[-PassThru]
[-ThrottleLimit <Int32>]
Disconnect-VirtualDisk
[-AsJob]
[-CimSession <CimSession[]>]
[-PassThru]
[-ThrottleLimit <Int32>]
-UniqueId <String[]>
Disconnect-VirtualDisk
[-AsJob]
[-CimSession <CimSession[]>]
[-PassThru]
[-ThrottleLimit <Int32>]
-InputObject <CimInstance[]>
Disconnect-VirtualDisk
[-AsJob]
[-CimSession <CimSession[]>]
[-PassThru]
[-ThrottleLimit <Int32>]
-Name <String[]>
Description
The Disconnect-VirtualDisk cmdlet disconnects a virtual disk from the specified computer, revoking access to the virtual disk.
Examples
Example 1: Disconnect a virtual disk by friendly name
PS C:\>Disconnect-VirtualDisk -FriendlyName VirtualDisk01
This example disconnects a virtual disk named VirtualDisk01 from the local machine to prevent futher access to the virtual disk.
Parameters
-AsJob
ps_cimcommon_asjob
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-CimSessionhttp://go.microsoft.com/fwlink/p/?LinkId=227967 or Get-CimSessionhttp://go.microsoft.com/fwlink/p/?LinkId=227966 cmdlet. The default is the current session on the local computer.
Type: | CimSession[] |
Aliases: | Session |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-FriendlyName
Specifies the friendly name of the virtual disk to disconnect.
Type: | String[] |
Position: | 1 |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-InputObject
Specifies the VirtualDisk object to disconnect. Enter a VirtualDisk CIM object, which you can get by using the Get-VirtualDisk cmdlet.
Type: | CimInstance[] |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-Name
Specifies the name of the virtual disk to disconnect.
Type: | String[] |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-PassThru
Specifies that the cmdlet should output an object representing the disconnected virtual disk. By default, this cmdlet does not generate any output.
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-ThrottleLimit
Specifies the maximum number of concurrent operations that can be established to run the cmdlet.
If this parameter is omitted or a value of 0
is entered, then Windows PowerShell® calculates an optimum throttle limit for the cmdlet based on the number of CIM cmdlets that are running on the computer.
The throttle limit applies only to the current cmdlet, not to the session or to the computer.
Type: | Int32 |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-UniqueId
Specifies the UniqueID of the virtual disk to disconnect.
Type: | String[] |
Aliases: | Id |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
Inputs
You can pipe VirtualDisk objects to the InputObject parameter to specify one or more virtual disks to disconnect.
Outputs
The Disconnect-VirtualDisk cmdlet does not output objects unless you use the Passthru parameter, in which case it outputs objects that represent the virtual disks that you disconnected.
Related Links
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for