Complete Guide to PowerShell Commands for Windows

  • Operation based on verb-noun syntax for object management and task automation.
  • Advanced management capabilities for processes, services, files, and local or remote network connectivity.
  • Implementation of security policies, digital signatures, and operating system auditing.
  • Use of specialized modules and pipelining to optimize the system administrator's workflow.

Laptop screen showing a Windows PowerShell console with system automation and management code in dark mode.

If you've ever felt limited by the classic Command Prompt, let me tell you that Windows hides a gem called PowerShell. This tool isn't just a black window for typing letters; it's a powerful automation environment based on the .NET Framework that allows any user, from the most novice to the most advanced systems engineer, to take complete control of their computer and network.

What makes this console so special is that it doesn't just execute simple commands; it handles complex objects . This means you can chain commands, filter data, and create scripts that do the tedious work for you, allowing you to manage anything from a simple text file to the entire infrastructure of an enterprise server without ever taking your fingers off the keyboard.

Install Windows UniGetUI
Related article:
How to install and manage packages on Windows with UniGetUI

The architecture of Cmdlets

Systems administrator working with a laptop in a modern data center.

To avoid getting lost in this universe, the first thing to understand is that the commands here are called cmdlets . The magic lies in their logical verb-noun structure , separated by a hyphen. For example, if you want to get something, you'll use the verb "Get"; if you want to create an item, you'll use "New". This consistency means that, once you get the hang of it, you'll hardly need to look at the manual.

Within this ecosystem, there are aliases , which are essentially shortcuts. If you're coming from Linux or the command prompt, you'll feel right at home because you can use Linux applications in Windows and PowerShell will automatically translate them to the actual command, making the learning curve easier for those already experienced with other consoles.

How to have split screen in Windows
Related article:
Windows 11 as a test lab host

Essential commands for everyday use

When you're starting out, there are three commands that are like bread and butter. First, there's Get-Help , which is basically the built-in instruction manual; if you don't know how to use a cmdlet, you ask it, and it gives you the syntax and examples. Then there's Get-Command , ideal for when you remember a keyword but not the exact command name, as it lists all the available options.

For those who need to keep an eye on what's happening on their PC, Get-Process and Get-Service are essential. While the former tells you which applications are consuming RAM or CPU, the latter tells you which system services are active or stopped, saving you from having to open the cumbersome Task Manager every two minutes.

Advanced file and directory management

Programmer working on script development in a dual monitor environment.

Navigating folders is a breeze with Set-Location (to change the path) and Get-ChildItem (to see what's inside). But things get interesting when we start manipulating data. With New-Item we create files or folders from scratch, and with Copy-Item or Move-Item we organize the chaos on our hard drive.

Secure resource sharing in Windows 11: a complete guide
Related article:
Secure resource sharing in Windows 11: a complete guide

If you need to read a file without opening Notepad, Get-Content is your best friend. And if you want to do the opposite—write data to a file—you can use Set-Content or Add-Content . For the more organized, there's Out-File , which lets you dump the output of any command directly into a text document, which is invaluable for generating quick reports.

Process and service management

When an application freezes and becomes unresponsive, Stop-Process is the definitive solution for forcing it to close using the process name or ID. On the other hand, if you need to launch a program, Start-Process does the job. For services, the Start-Service , Stop-Service , and Restart-Service trio allows you to manage Windows startup without accessing the graphical interface.

An advanced trick is the use of Where-Object . This command acts as a powerful filter that allows you, for example, to list only the processes that consume more than 10% of the memory or only the services that are in the "Running" state , saving time by not having to read endless lists of irrelevant data.

Security and enforcement policies

IT technician managing servers and networks in a professional rack room.

PowerShell isn't a game, and that's why it has a security system called Execution Policy . You can't just run any script you find online for obvious reasons. Using `Get-ExecutionPolicy` you can see the current policy level, and with `Set-ExecutionPolicy` you can change it to "RemoteSigned" or "Unrestricted" mode if you fully trust the code you're about to run.

Verify the integrity of an ISO image in Windows
Related article:
How to verify the integrity of an ISO image in Windows using checksums and signatures

For those seeking an industrial-grade level of security, tools like Set-AuthenticodeSignature allow you to digitally sign scripts. This way, anyone who receives them will know the file hasn't been tampered with . It's also possible to manage file permissions by manipulating Access Control Lists (ACLs) with the Get-ACL and Set-ACL commands.

Connectivity and remote management

Professional portrait of a systems administrator in a modern technology office.

One of the most powerful features is the ability to control other computers. Using Enter-PSSession , you can open a console on a remote server and execute commands as if you were sitting right in front of it. If you prefer not to log in interactively, Invoke-Command allows you to issue a command to multiple servers at once, which is a boon for large-scale administration.

Regarding networking, Test-Connection is the modern version of ping, allowing you to verify if a host is responding. For those who need to investigate further, Resolve-DnsName is fantastic for checking name resolution and analyzing the DNS records of a specific domain, similar to how advanced Windows Firewall rules are configured.

Specialized modules and the DRDA case

PowerShell is extensible thanks to modules. A prime example is the Microsoft.HostIntegration.PowerShell module used in DRDA services. This system allows you to manage complex database configurations, handling database aliases and date and time conversions using specific cmdlets such as Set-HisDrdaService or Get-HisDrdaSqlServerConnection.

Containers in Windows: When do they make sense?
Related article:
Containers in Windows: when do they make sense

These types of modules allow for highly specific tasks, such as configuring Trace Listeners to monitor errors in real time or managing Code Pages to ensure that data between different systems is not corrupted, demonstrating that the tool is suitable for critical corporate environments.

Debugging and monitoring tricks

For script developers, Debug-Process and breakpoint management with Enable-PSBreakpoint are vital for finding errors in code. Additionally, the Get-Counter command allows you to extract real-time system performance data, enabling you to analyze CPU or disk bottlenecks without installing external software.

If you need to clear your history, `Clear-History` deletes the commands executed in the session, while `Get-History` returns a list of what you've done. To pause script execution and prevent system overload, `Start-Sleep` is the perfect instruction for introducing delays of a few seconds.

Having a solid grasp of these tools transforms how you interact with Windows, turning you from a passive user into an administrator capable of automating the management of files, processes, security, and networks. From using simple aliases to implementing digital signatures and remotely managing servers, the versatility of cmdlets allows you to optimize any technical workflow, ensuring that repetitive tasks become instantaneous and precise processes.

How to uninstall old drivers
Related article:
Guide to configuring Firewall rules in Windows to block apps

Add as preferred source in Google