Summary: Learn how to use Windows PowerShell to remove an assigned drive letter from a partition.
How can I use Windows PowerShell to remove a drive letter from a partition?
Use a combination of three cmdlets with the drive letter—for example, to remove drive letter X from the drive
it is assigned to, use
$DriveLetter=’X
Get-Volume -Drive $DriveLetter | Get-Partition | Remove-PartitionAccessPath
-accesspath "$DriveLetter`:\"