PowerTip: Use PowerShell to Remove Drive Letter

The Scripting Guys

Dr

Summary: Learn how to use Windows PowerShell to remove an assigned drive letter from a partition.

Hey, Scripting Guy! Question How can I use Windows PowerShell to remove a drive letter from a partition?

Hey, Scripting Guy! Answer 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`:\"

The Scripting Guys
Dr Scripto

Follow Dr   

No Comments.