Changing a Drive Letter With PowerShell
See how to change a drive letter with Powershell.
Join the DZone community and get the full member experience.Join For Free
Here is a short but sweet post on how to 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 Storage module into Powershell before you can do this.
Import-Module -Name Storage
Let me know if this helped you.
Published at DZone with permission of David Bermingham. See the original article here.
Opinions expressed by DZone contributors are their own.