Skip to main content

Windows 10: PowerShell to Assign Drive Letters

If a drive is missing on your device, it could be a letter assignment issue.
Follow the steps below to using PowerShell to quickly assign a new letter.

Step 1
Search for Windows PowerShell in the start menu, right-click the result, and select Run as administrator.

Step 2
Run the following command to get the disk information
Get-Disk
Step 3
Run the following command to get the partition information
Get-Partition -DiskNumber 1
Step 4
Run the following command to assign the drive letter
Get-Partition -DiskNumber 1 -PartitionNumber 2 | Set-Partition -NewDriveLetter Z
In the above command, replace the following;
1 with the Drive Number you want to assign letters
2 with the Partition Number you want to assign letter
Z with the Drive Letter you want to assign



Once you’ve completed the steps, the hard drive will now appear in File Explorer.

Comments