Get-AvailableDriveLetter

Get-AvailableDriveLetter

Returns an array of the available drive letters.

Sintaxis

Parameter Set: Default
Get-AvailableDriveLetter [-ReturnFirstLetterOnly] [ <CommonParameters>]

Descripción detallada

Returns an array of all available drive letters, or optionally only the first available drive letter.

Parámetros

-ReturnFirstLetterOnly

Alias

ninguno

¿Requerido?

false

¿Posición?

named

Valor predeterminado

ninguno

¿Aceptar canalización?

false

¿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.

  • None

Salidas

El tipo de resultado es el tipo de objetos que emite el cmdlet.

  • System.String

    This cmdlet outputs an array of strings that stores the available drive letters.

Ejemplos

Example 1 – Get all available drive letters

PS C:\> Get-AvailableDriveLetter

Example 2 – Get the first available drive letter

PS C:\> Get-AvailableDriveLetter -ReturnFirstLetterOnly