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.
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.
You should read it
- Use PowerShell to download any file on Windows 10
- How are Command Prompt (cmd) and PowerShell different?
- How to install PowerShell 7.0 in Windows 10/8/7
- How to use PowerShell's default parameter to change the command behavior
- Instructions on how to use PowerShell in Windows Server 2012
- 10 PowerShell commands help you manage the remote computer most effectively
- What is PowerShell Basic commands in PowerShell
- How to check PowerShell version in Windows 10
May be interested
- How to delete a partition on Windows hard drive?for some reason, for example, if you don't want to use a partition on a hard drive or faulty partition that forces you to delete the partition, then you can follow the steps below to delete one. partition on the hard drive.
- What is PowerShell Basic commands in PowerShellwhat is powershell basic commands in powershell. first of all, to understand it briefly, powershell is a command-line interface similar to cmd, it can do everything cmd can do and even more. powershell is gradually becoming the default
- How to delete a partition on Windows hard drive?the article below will guide you how to delete any partition on windows 10/11... without having to install any other utilities.
- PowerShell and everything you need to know about itwhat is powershell? microsoft powershell is a command line utility and scripting language that is a powerful tool for administrators that helps you automate a wide range of computer and network tasks.
- How to check PowerShell version in Windows 10powershell is one of the extremely useful command tools for advanced windows 10 users.
- 10 useful commands in Windows you should knowcommand prompt is used to execute batch files, perform tasks quickly, help you troubleshoot and solve some windows problems when the system crashes. however, not all commands in windows are useful and must be done regularly. with the 10 command lines in the following article it is very useful even if you are not an administrator.
- Reg delete command in Windowsthe reg delete command helps delete subkeys or entries in the registry
- How to Install or Update PowerShell on Windows 11windows powershell is a command line tool developed by microsoft that helps you automate common tasks on your system.
- Use PowerShell to create EventLogin the following article, i will show you how to use powershell to create log records on the system, namely the write-eventlog cmdlet command. the basic syntax of this command takes the form ...
- How to add 'Open PowerShell window here as administrator' to the right-click menu on Windows 10windows 10 comes with windows powershell 5.0. windows powershell is a task-based command-line shell and scripting language specifically designed for system administration. this tutorial will show you how to add or remove 'open powershell window here as administrator' on windows 10 right-click menu.