How to delete a partition using the PowerShell command

Step 1. Open the PowerShell application with admin rights. To do that, right-click on the Start menu and select the option "Windows PowerShell (Admin)" .

Step 2. Get the list of partitions using the "Get-Volume" cmdlet . This command will display a table in the PowerShell window with all available partitions.

How to delete a partition using the PowerShell command Picture 1

Step 3. To remove a partition, execute the command below. Replace "X" with the actual drive letter of the partition you want to delete. For example, to delete partition "E" , replace "X" with the drive letter.

Remove-Partition -DriveLetter X

How to delete a partition using the PowerShell command Picture 2

Step 4. Type "Y" into the PowerShell window and press Enter. This action will confirm that you really want to get rid of the target partition.

How to delete a partition using the PowerShell command Picture 3

As soon as you confirm the action, Windows PowerShell will delete the partition and mark it as unallocated.

Since the deleted space is marked as unallocated, you can use it to create a new partition or extend an existing one. If you want to extend the partition, we recommend first backing up all the files in the partition you want to extend.

Furthermore, use the partition manager GUI tool, like the built-in Disk Management tool. This is especially important if you've never done this through the command line.

4 ★ | 6 Vote

May be interested

  • How to Login to the Adminstrator account of a Windows computerPhoto of How to Login to the Adminstrator account of a Windows computer
    detailed instructions on how to access adminstrator account on all windows operating systems. you can enter your computer forgot or lost your password easily ..
  • How to enable boot sound on ChromebookPhoto of How to enable boot sound on Chromebook
    by default, chromebooks (chrome os) don't have this feature. but if you like, you can fully activate it.
  • How to block access to a computer's hard drive on Windows 10Photo of How to block access to a computer's hard drive on Windows 10
    how to block access to windows computer's hard drive? how to block users from accessing any hard drive partition, or block access to the hard drive.
  • How to delete the Ansel folder on the computerPhoto of How to delete the Ansel folder on the computer
    how to delete the ansel folder. the ansel folder only appears on computers with discrete nvidia cards with the main purpose of saving high-quality screenshots and hdr images while playing games. what's special is when you delete this folder and it can reappear
  • How to change a password on a ChromebookPhoto of How to change a password on a Chromebook
    this article will guide you to change your chromebook password, that is to change your google account password accordingly. the reason is that chromebook passwords and google passwords are similar.
  • How to set the opening sound on ChromebookPhoto of How to set the opening sound on Chromebook
    traditional computers have the sound of turning on the machine as soon as the system is turned on and started running. chromebooks don't have this feature by default, but if you remember the same opening sounds you would have on older computers, you can activate it manually via your device's settings.