PowerShell Logo Small

Connect-VirtualDisk



This is the built-in help made by Microsoft for the command 'Connect-VirtualDisk', in PowerShell version 3 - as retrieved from Windows version 'Microsoft Windows Server 2012 Standard' PowerShell help files on 2016-06-23.

For PowerShell version 3 and up, where you have Update-Help, this command was run just before creating the web pages from the help files.

SYNOPSIS

Connects a disconnected virtual disk to the specified computer when using the Storage Spaces subsystem.

SYNTAX


Connect-VirtualDisk [-FriendlyName] <String[]> [-AsJob [<SwitchParameter>]] [-CimSession <CimSession[]>] [-PassThru [<SwitchParameter>]]
[-ThrottleLimit <Int32>] [<CommonParameters>]
Connect-VirtualDisk [-AsJob [<SwitchParameter>]] [-CimSession <CimSession[]>] [-PassThru [<SwitchParameter>]] [-ThrottleLimit <Int32>]
-InputObject <CimInstance[]> [<CommonParameters>]
Connect-VirtualDisk [-AsJob [<SwitchParameter>]] [-CimSession <CimSession[]>] [-PassThru [<SwitchParameter>]] [-ThrottleLimit <Int32>] -Name
<String[]> [<CommonParameters>]
Connect-VirtualDisk [-AsJob [<SwitchParameter>]] [-CimSession <CimSession[]>] [-PassThru [<SwitchParameter>]] [-ThrottleLimit <Int32>]
-UniqueId <String[]> [<CommonParameters>]



Search powershellhelp.space

DESCRIPTION


The Connect-VirtualDisk cmdlet connects a disconnected virtual disk to the specified computer when using the Storage Spaces subsystem.


To connect to a virtual disk to a remote computer, use the CimSession parameter, or use the Enter-PSSession or Invoke-Command cmdlets in
conjunction with Connect-VirtualDisk.



<

RELATED LINKS

Invoke-Command
Disconnect-VirtualDisk
Get-VirtualDisk
Hide-VirtualDisk
New-VirtualDisk
Remove-VirtualDisk
Repair-VirtualDisk
Resize-VirtualDisk
Set-VirtualDisk
Show-VirtualDisk

REMARKS

<

Examples


Example 1: Connect a virtual disk to the local computer

PS C:\> Connect-VirtualDisk –FriendlyName "VirtualDisk1"



This example connects the virtual disk named VirtualDisk1 to the local computer.




Example 2: Connect all disconnected virtual disks on a remote server

PS C:\> Get-VirtualDisk –CimSession Srv2 | Where-Object -Filter { $_.OperationalStatus -eq "Detached" } | Connect-VirtualDisk



This example uses the Get-VirtualDisk cmdlet to get all virtual disk objects on the computer Srv2 (by using the CimSession parameter). It then
pipes the objects to the Where-Object cmdlet to filter out all virtual disks except those with the “Detached” operational status. Finally, it
pipes these objects to the Connect-VirtualDisk cmdlet.




Example 3: Connect all disconnected virtual disks on two remote computers by using Invoke-Command

PS C:\> Invoke-Command -ComputerName Srv1, Srv2 -ScriptBlock { Get-VirtualDisk | Where-Object -Filter { $_.OperationalStatus -eq "Detached" }
| Connect-VirtualDisk }



This example uses the Invoke-Command cmdlet to run the cmdlets specified in Example 2 (now specified in the ScriptBlock parameter) on multiple
remote computers simultaneously, with all processing done in parallel on each computer and only the results being sent back to the local
PowerShell session.