How to delete a partition using the PowerShell command
You can delete any partition in Windows 10 with a PowerShell command. Here is the exact command and how to execute it.
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.
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
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.
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.
- How are Command Prompt (cmd) and PowerShell different?
- Use PowerShell to download any file on Windows 10
- About PowerShell
- How to replace Command Prompt with PowerShell in the Power Menu on Windows 10
- What are the differences between Command Prompt and PowerShell?
- How to use PowerShell's default parameter to change the command behavior
- 10 PowerShell commands help you manage the remote computer most effectively
- How to install PowerShell 7.0 in Windows 10/8/7
- Instructions on how to use PowerShell in Windows Server 2012
- This is how to delete Recovery partition and Recovery partition 450 MB on Windows 10
- How to delete a partition on Windows hard drive?
- The difference between Command Prompt and Windows PowerShell
- What is PowerShell Basic commands in PowerShell
- How to delete a partition on Windows hard drive?