PowerShell is a task-based command-line shell and scripting language built on .NET. PowerShell helps system administrators and power-users rapidly automate tasks that manage operating systems and processes. PowerShell commands let you manage computers from the command line. It includes a rich expression parser and a fully developed scripting language.
PowerShell can do so much tasks, then is it possible to resize partition with PowerShell? The answer is yes. In this article, I'll show you how to shrink and extend partition with PowerShell in Windows Server 2019.
Firstly, press Windows and X on the keyboard, then select Windows PowerShell (Admin) in the list.
Steps to shrink partition/volume with PowerShell in Windows Server 2019:
Immediately, PowerShell reports this drive is successfully shrunk.
If you want to extend partition with PowerShell, it is not so easy as shrinking. Firstly, you have to delete the right contiguous partition. If there's no or you cannot delete this partition, PowerShell cannot help you extend partition.
Steps to extend partition with Powershell in Windows Server 2019:
Run list volume again, as you see, C drive is extended from 40GB to 110GB.
After running diskpart in PowerShell, run help shrink and help extend, you'll see the restrictions of PowerShell to resize partition in Windows Server 2019.
Limitations to resize partition volume with PowerShell on Windows Server 2019:
If you run Windows Server 2019 Disk Management to resize partition, there are the same restrictions, so you'd better run server partition software.
Download NIUBI Partition Editor and follow the steps in the video to shrink and extend partition.
Besides shrinking and extending partitions, it helps you do many other disk and partition operations.➤