Get-AvailableDriveLetter
Returns an array of the available drive letters.
Syntax
Get-AvailableDriveLetter
[-ReturnFirstLetterOnly]
Description
Returns an array of all available drive letters, or optionally only the first available drive letter.
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
Parameters
-ReturnFirstLetterOnly
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Inputs
None
Outputs
This cmdlet outputs an array of strings that stores the available drive letters.
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for