Get-AvailableDriveLetter
Published: February 6, 2013
Updated: February 6, 2013
Applies To: Windows 8, Windows Server 2012
Get-AvailableDriveLetter
Syntax
Parameter Set: Default Get-AvailableDriveLetter [-ReturnFirstLetterOnly] [ <CommonParameters>]
Detailed Description
Returns an array of all available drive letters, or optionally only the first available drive letter.
Parameters
-ReturnFirstLetterOnly
|
Aliases |
none |
|
Required? |
false |
|
Position? |
named |
|
Default Value |
none |
|
Accept Pipeline Input? |
false |
|
Accept Wildcard Characters? |
false |
<CommonParameters>
This cmdlet supports the common parameters: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer, and -OutVariable. For more information, see about_CommonParameters.
Inputs
The input type is the type of the objects that you can pipe to the cmdlet.
- None
Outputs
The output type is the type of the objects that the cmdlet emits.
-
System.String
This cmdlet outputs an array of strings that stores the available drive letters.
Notes
-
The StorageSpaces module is a downloadable module available for use with Windows Server 2012 and Windows 8. You can download the module from the Script Center.
Examples
Example 1 – Get all available drive letters
PS C:\> Get-AvailableDriveLetter
Example 2 – Get the first available drive letter
PS C:\> Get-AvailableDriveLetter -ReturnFirstLetterOnly
