Changing a Drive Letter with PowerShell

Here is a short but sweet post on change the drive letter of a partition. Despite using my best Google skills I couldn't find an example that was doing it for me. I rolled up my sleeves and just figured it out on my own. I hope this helps someone out there.

Set-Partition -DiskNumber 4 -PartitionNumber 1 -NewDriveLetter X

As long as you know the DiskNumber and PartitionNumber this will immediately change the drive letter of the partition you specify.

You may also need to import the module into Powershell before you can do this.

Import-Module -Name Storage

Let me know if this helped you


This article was originally published by Microsoft's Entra (Azure AD) Blog. You can find the original article here.