Connect-VirtualDisk
Connect-VirtualDisk
Connects a disconnected virtual disk to the specified computer when using the Storage Spaces subsystem.
Sintaxis
Parameter Set: ByFriendlyName
Connect-VirtualDisk [-FriendlyName] <String[]> [-AsJob] [-CimSession <CimSession[]> ] [-PassThru] [-StorageNodeName <String> ] [-ThrottleLimit <Int32> ] [ <CommonParameters>]
Parameter Set: ByName
Connect-VirtualDisk -Name <String[]> [-AsJob] [-CimSession <CimSession[]> ] [-PassThru] [-StorageNodeName <String> ] [-ThrottleLimit <Int32> ] [ <CommonParameters>]
Parameter Set: ByUniqueId
Connect-VirtualDisk -UniqueId <String[]> [-AsJob] [-CimSession <CimSession[]> ] [-PassThru] [-StorageNodeName <String> ] [-ThrottleLimit <Int32> ] [ <CommonParameters>]
Parameter Set: InputObject (cdxml)
Connect-VirtualDisk -InputObject <CimInstance[]> [-AsJob] [-CimSession <CimSession[]> ] [-PassThru] [-StorageNodeName <String> ] [-ThrottleLimit <Int32> ] [ <CommonParameters>]
Descripción detallada
The Connect-VirtualDisk cmdlet connects a disconnected virtual disk to the specified computer when using the Storage Spaces subsystem.
To connect a virtual disk to a remote computer, from a management node in a subsystem that is registered on the management node, specify the StorageNodeName parameter.
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.
Parámetros
-AsJob
Alias |
ninguno |
¿Requerido? |
false |
¿Posición? |
named |
Valor predeterminado |
ninguno |
¿Aceptar canalización? |
false |
¿Aceptar caracteres comodín? |
false |
-CimSession<CimSession[]>
Ejecuta el cmdlet en una sesión remota o en un equipo remoto. Escriba un nombre de equipo o un objeto de sesión, como la salida de un cmdlet New-CimSession o Get-CimSession. El valor predeterminado es la sesión actual en el equipo local.
Alias |
Session |
¿Requerido? |
false |
¿Posición? |
named |
Valor predeterminado |
ninguno |
¿Aceptar canalización? |
false |
¿Aceptar caracteres comodín? |
false |
-FriendlyName<String[]>
Specifies the friendly name of the virtual disk that you want to connect.
Alias |
ninguno |
¿Requerido? |
true |
¿Posición? |
1 |
Valor predeterminado |
ninguno |
¿Aceptar canalización? |
True (ByPropertyName) |
¿Aceptar caracteres comodín? |
false |
-InputObject<CimInstance[]>
Specifies a VirtualDisk object or an array of VirtualDisk objects to connect. Enter a VirtualDisk CIM object or an array of VirtualDisk objects.
Alias |
ninguno |
¿Requerido? |
true |
¿Posición? |
named |
Valor predeterminado |
ninguno |
¿Aceptar canalización? |
True (ByValue) |
¿Aceptar caracteres comodín? |
false |
-Name<String[]>
Specifies the name of the virtual disk that you want to connect.
Alias |
ninguno |
¿Requerido? |
true |
¿Posición? |
named |
Valor predeterminado |
ninguno |
¿Aceptar canalización? |
True (ByPropertyName) |
¿Aceptar caracteres comodín? |
false |
-PassThru
Specifies that the cmdlet should output an object representing a virtual disk. By default, this cmdlet does not generate any output.
Alias |
ninguno |
¿Requerido? |
false |
¿Posición? |
named |
Valor predeterminado |
ninguno |
¿Aceptar canalización? |
false |
¿Aceptar caracteres comodín? |
false |
-StorageNodeName<String>
Specifies the name of a computer on which to run the cmdlet.
Use this parameter only when you run the cmdlet from a management node to connect a virtual disk to a remote cluster subsystem for the purpose of setting the virtual disk to manual-attach. To set a virtual disk to manual-attach, use the Set-VirtualDisk cmdlet and specify the IsManualAttach parameter.
Alias |
ninguno |
¿Requerido? |
false |
¿Posición? |
named |
Valor predeterminado |
ninguno |
¿Aceptar canalización? |
false |
¿Aceptar caracteres comodín? |
false |
-ThrottleLimit<Int32>
Especifica el número máximo de operaciones simultáneas que se pueden establecer para ejecutar el cmdlet. Si se omite este parámetro o es especifica un valor de 0
, Windows PowerShell ® calcula un límite óptimo para el cmdlet en función del número de cmdlets de CIM que se estén ejecutando en el equipo. El límite solo se aplica al cmdlet actual, no a la sesión ni al equipo.
Alias |
ninguno |
¿Requerido? |
false |
¿Posición? |
named |
Valor predeterminado |
ninguno |
¿Aceptar canalización? |
false |
¿Aceptar caracteres comodín? |
false |
-UniqueId<String[]>
Specifies the UniqueID of the virtual disk to connect.
Alias |
Id |
¿Requerido? |
true |
¿Posición? |
named |
Valor predeterminado |
ninguno |
¿Aceptar canalización? |
True (ByPropertyName) |
¿Aceptar caracteres comodín? |
false |
<CommonParameters>
Este cmdlet admite los siguientes parámetros comunes: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer y -OutVariable. Para obtener más información, consulte about_CommonParameters (https://go.microsoft.com/fwlink/p/?LinkID=113216).
Entradas
El tipo de entrada es el tipo de los objetos que se pueden canalizar al cmdlet.
Microsoft.Management.Infrastructure.CimInstance#ROOT/Microsoft/Windows/Storage/MSFT_VirtualDisk
You can pipe VirtualDisk objects to the InputObject parameter to specify one or more virtual disks to connect to the local computer.
Salidas
El tipo de resultado es el tipo de objetos que emite el cmdlet.
Microsoft.Management.Infrastructure.CimInstance#ROOT/Microsoft/Windows/Storage/MSFT_VirtualDisk
The Connect-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 connected.
Notas
- El objeto
Microsoft.Management.Infrastructure.CimInstance
es una clase contenedora que muestra objetos de Instrumental de administración de Windows (WMI). La ruta de acceso después del signo de número (#
) proporciona el espacio de nombres y el nombre de clase del objeto WMI subyacente.
Ejemplos
Example 1: Connect a virtual disk to the local computer
This example connects the virtual disk named VirtualDisk1 to the local computer.
PS C:\> Connect-VirtualDisk –FriendlyName "VirtualDisk1"
Example 2: Connect all disconnected virtual disks on a remote server
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.
PS C:\> Get-VirtualDisk –CimSession Srv2 | Where-Object -Filter { $_.OperationalStatus -eq "Detached" } | Connect-VirtualDisk
Example 3: Connect all disconnected virtual disks on two remote computers by using Invoke-Command
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.
PS C:\> Invoke-Command -ComputerName Srv1, Srv2 -ScriptBlock { Get-VirtualDisk | Where-Object -Filter { $_.OperationalStatus -eq "Detached" } | Connect-VirtualDisk }
Example 4: Connect a virtual disk to a remote computer from a management node
This example connects a virtual disk to a remote computer from a management node in a subsystem that is registered on the management node.
PS C:\> Get-StorageSubSystem –FriendlyName "Clustered Storage Spaces on Cluster01" | Get-VirtualDisk –FriendlyName "VDisk01" | Connect-VirtualDisk –StorageNodeName "ClustNode1"