Get-Disk
Gets one or more disks visible to the operating system.
Parameter Set: ByNumber
Get-Disk [[-Number] <UInt32[]> ] [-AsJob] [-CimSession <CimSession[]> ] [-ThrottleLimit <Int32> ] [ <CommonParameters>]
Parameter Set: ByiSCSIConnection
Get-Disk [-AsJob] [-CimSession <CimSession[]> ] [-iSCSIConnection <CimInstance> ] [-ThrottleLimit <Int32> ] [ <CommonParameters>]
Parameter Set: ByiSCSISession
Get-Disk [-AsJob] [-CimSession <CimSession[]> ] [-iSCSISession <CimInstance> ] [-ThrottleLimit <Int32> ] [ <CommonParameters>]
Parameter Set: ByName
Get-Disk [-AsJob] [-CimSession <CimSession[]> ] [-FriendlyName <String[]> ] [-ThrottleLimit <Int32> ] [ <CommonParameters>]
Parameter Set: ByPartition
Get-Disk [-AsJob] [-CimSession <CimSession[]> ] [-Partition <CimInstance> ] [-ThrottleLimit <Int32> ] [ <CommonParameters>]
Parameter Set: ByPath
Get-Disk [-AsJob] [-CimSession <CimSession[]> ] [-Path <String[]> ] [-ThrottleLimit <Int32> ] [ <CommonParameters>]
Parameter Set: ByUniqueId
Get-Disk [-AsJob] [-CimSession <CimSession[]> ] [-ThrottleLimit <Int32> ] [-UniqueId <String[]> ] [ <CommonParameters>]
Parameter Set: ByVirtualDisk
Get-Disk [-AsJob] [-CimSession <CimSession[]> ] [-ThrottleLimit <Int32> ] [-VirtualDisk <CimInstance> ] [ <CommonParameters>]
The Get-Disk cmdlet gets one or more Disk objects visible to the operating system, or optionally a filtered list.
Alias |
ninguno |
¿Requerido? |
false |
¿Posición? |
named |
Valor predeterminado |
ninguno |
¿Aceptar canalización? |
false |
¿Aceptar caracteres comodín? |
false |
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 |
Gets the disk with the specified friendly name. Enter a friendly name, or use wildcard characters to enter a name pattern.
Alias |
ninguno |
¿Requerido? |
false |
¿Posición? |
named |
Valor predeterminado |
ninguno |
¿Aceptar canalización? |
false |
¿Aceptar caracteres comodín? |
false |
Specifies the disk number for which to get the associated Disk object.
Alias |
DeviceId |
¿Requerido? |
false |
¿Posición? |
1 |
Valor predeterminado |
ninguno |
¿Aceptar canalización? |
True (ByPropertyName) |
¿Aceptar caracteres comodín? |
false |
Accepts a Partition object as input. The Partition CIM object is exposed by the Get-Partition cmdlet.
Alias |
ninguno |
¿Requerido? |
false |
¿Posición? |
named |
Valor predeterminado |
ninguno |
¿Aceptar canalización? |
True (ByValue) |
¿Aceptar caracteres comodín? |
false |
Contains valid path information.
Alias |
ninguno |
¿Requerido? |
false |
¿Posición? |
named |
Valor predeterminado |
ninguno |
¿Aceptar canalización? |
True (ByPropertyName) |
¿Aceptar caracteres comodín? |
false |
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 |
Gets only the disks with the specified IDs. Type one or more IDs (separated by commas).
Alias |
Id |
¿Requerido? |
false |
¿Posición? |
named |
Valor predeterminado |
ninguno |
¿Aceptar canalización? |
false |
¿Aceptar caracteres comodín? |
false |
Accepts a VirtualDisk object as input. The Virtual Disk CIM object is exposed by the Get-VirtualDisk cmdlet.
Alias |
ninguno |
¿Requerido? |
false |
¿Posición? |
named |
Valor predeterminado |
ninguno |
¿Aceptar canalización? |
True (ByValue) |
¿Aceptar caracteres comodín? |
false |
Accepts an iSCSIConnection object as input. The iSCSI Connection CIM object is exposed by the Get-IscsiConnection cmdlet.
Alias |
ninguno |
¿Requerido? |
false |
¿Posición? |
named |
Valor predeterminado |
ninguno |
¿Aceptar canalización? |
True (ByValue) |
¿Aceptar caracteres comodín? |
false |
Accepts an iSCSISession object as input. The iSCSI Session CIM object is exposed by the Get-IscsiSession cmdlet.
Alias |
ninguno |
¿Requerido? |
false |
¿Posición? |
named |
Valor predeterminado |
ninguno |
¿Aceptar canalización? |
True (ByValue) |
¿Aceptar caracteres comodín? |
false |
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).
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_IscsiConnection
You can pipe an iSCSIConnection object to the iSCSIConnection parameter.
Microsoft.Management.Infrastructure.CimInstance#ROOT/Microsoft/Windows/Storage/MSFT_IscsiSession
You can pipe an iSCSISession object to the iSCSISession parameter.
Microsoft.Management.Infrastructure.CimInstance#ROOT/Microsoft/Windows/Storage/MSFT_Partition
You can pipe a Partition object to the Partition parameter.
Microsoft.Management.Infrastructure.CimInstance#ROOT/Microsoft/Windows/Storage/MSFT_VirtualDisk
You can pipe a VirtualDisk object to the VirtualDisk parameter.
El tipo de resultado es el tipo de objetos que emite el cmdlet.
Microsoft.Management.Infrastructure.CimInstance#ROOT/Microsoft/Windows/Storage/MSFT_Disk
This cmdlet outputs one or more objects representing disks.
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.Some objects such as disks might include trailing spaces in their friendly names. If you suspect that an object name could have trailing spaces, you can use a wildcard at the end of the name, for example Disk*, or use the Match parameter to instruct Windows PowerShell to include all strings that include the specified characters, instead of only strings that include only the specified characters.
This example gets all disks visible to the operating system.
PS C:\> Get-Disk
This example gets disk 6.
PS C:\> Get-Disk -Number 6
This example gets all disks attached via the USB bus by piping the output of Get-Disk to the Where-Object cmdlet, and filtering by the USB value of the Bustype property.
PS C:\> Get-Disk | Where-Object –FilterScript {$_.Bustype -Eq "USB"}
This example gets all disks attached via the iSCSI bus by piping the output of Get-Disk to the Where-Object cmdlet, and filtering by the iSCSI value of the Bustype property. It then passes the Disk objects in the pipeline to the Get-IscisSession cmdlet, which gets the associated iSCSI sessions, and then pipes the output to the Format-Table cmdlet for simplified display.
PS C:\> Get-Disk | Where-Object –FilterScript {$_.BusType -Eq "iSCSI"} |
Get-IscsiSession | Format-Table