Windows tries to be simple and easygoing. Its GUI offers everything you need to control and manage an operating system, at least for a basic user. You'll rarely find the need to jump into a terminal window and execute a command or script. Before Windows Terminal existed, CMD and PowerShell were separate command-line environments, and Windows Terminal can now host both of them in tabs. Microsoft presents PowerShell as a command-line shell and scripting language, and it offers capabilities that are broader than those of Command Prompt in many scripting scenarios.

You might not even realize the true power of this bleak-looking tool. It can help you automate tasks, manage system elements, create custom scripts, and manage other Windows systems remotely in supported environments.

PowerShell is your CLI friend

Simple yet powerful

To a basic user, a terminal interface is just a place where they type commands. It sounds way more complicated than clicking a button or navigating menus, and thus many Windows users try to avoid it. But PowerShell can perform many administrative tasks and can automate actions that are not exposed through standard system apps.

But how is PowerShell able to do that? It's because PowerShell is both a CLI and a scripting language. The crux of that is that you get access to useful cmdlets (short, powerful commands for controlling system elements like processes or files). PowerShell can manipulate .NET objects using these cmdlets, meaning it can access the information associated with a particular element of the OS. Then you can use it to pass information from one cmdlet to another in a single line and build an awesome set of custom scripts.

PowerShell works with structured objects and system APIs, which makes many administrative tasks easier to script and automate. Since PowerShell uses a verb-noun format, the cmdlets are easier to understand and learn because they resemble text and words you normally use. It understands structured data and supports logic and conditions, giving you an advantage.

A simple example is the Get-Process cmdlet, which returns process objects for the running processes on your system.

Next, you can ask it to list running processes in descending order by piping the data from the first cmdlet to Sort-Object:

Get-Process | Sort-Object WorkingSet -Descending

Note how the command syntax looks like a basic sentence where each word describes the thing it will affect, call, or do. I can further modify the command to stop the top three processes by memory usage.

Get-Process | Sort-Object WorkingSet -Descending | Select-Object -First 3 | Stop-Process -Force

But can't you do the same thing in Command Prompt? Yes, you can, but there are several limitations. You must understand that it is a legacy tool that can run commands and output plain text. But it cannot process structured data the way PowerShell can, which limits CMD’s suitability for modern Windows scripting scenarios.

I can list all the processes in CMD using the tasklist command, but arranging the results in descending order is a bit complex. I have to use tasklist /NH | sort /R /+65.

Here, I first tell it to skip the column headers with /NH, then pipe the results into a sorting command that sorts the text descending from the 65th character position. It's more of a trick to manipulate text than to access structured data, and it is difficult to understand because it doesn't follow a verb-noun structure. So, scripting becomes tedious and complex.

Automation and scripting

Granular system control

Running PowerShell scripts to fix something on my PC or do a task that requires manual intervention is my hobby now. There are several essential scripts that I prefer using, and automating them via Task Scheduler saves me a lot of time. The only hurdle is writing the script, but several useful scripts are already available on forums and other platforms.

A good example is finding all the files in a particular directory that are larger than a certain size (let's say 5GB). If you want to do that using File Explorer, the experience is slow, and you can’t automate it beyond the search. PowerShell or a third-party tool is usually the best option if you want reliable automation for this kind of file task.

I can create a custom script that weeds out all files above a specified size and even performs operations (move, delete, etc.) on them. Then I can use Task Scheduler to automate this custom script, which runs at my specified time interval. So, my workflow now doesn't require my manual intervention for such trivial actions. Task Scheduler will run the script in the background at the time or interval I specify.

It's just one of the many PowerShell scripts that make your life easier. My interaction with GUI tools becomes almost negligible with this approach.

Don't ignore PowerShell

Windows 11 needs a lot of tuning, and running custom PowerShell scripts can help you make the changes faster. There are other PowerShell features, such as remote management and log-based troubleshooting, that are used more often in enterprise environments, but I use it mostly for automation and to exercise greater system control. There’s a learning curve to building custom scripts, but you’ll be happy once you master it.