Unlock Windows Power: 10 Essential PowerShell Commands for Every User
Windows PowerShell is an exceptionally powerful command-line shell and scripting environment designed by Microsoft to enable system administrators and advanced users to automate tasks and manage Windows systems efficiently. While it might seem intimidating due to its lack of a graphical user interface (GUI), PowerShell is indispensable when the standard GUI fails or when you need to perform repetitive or complex operations across your system. Many common tasks can be executed faster and more reliably using PowerShell commands, known as cmdlets, compared to manual clicks through various windows. This guide explores ten fundamental PowerShell cmdlets that can significantly enhance a regular Windows user’s ability to interact with and manage their operating system.
Navigating the command line can initially feel daunting, but mastering a few core cmdlets opens up a world of possibilities for controlling your PC. These commands follow a consistent “Verb-Noun” syntax, which makes them relatively easy to understand and remember once you grasp the pattern. For instance, cmdlets often start with verbs like Get (to retrieve data), Set (to change data), New (to create an item), Remove (to delete an item), or Start (to begin a process or service). The noun specifies the type of item the cmdlet acts upon, such as Process, Service, or Item.
Before diving into using these powerful tools, it is strongly recommended to create a System Restore point. While the commands presented here are generally safe for common tasks, system configurations can be complex, and unforeseen issues can arise. A restore point acts as a snapshot of your system’s state, allowing you to roll back any changes if something unexpected occurs, providing peace of mind as you explore PowerShell’s capabilities.

Here are ten essential PowerShell cmdlets that can empower you to do more on your Windows computer:
- Launch a UWP Application.
- Get Help regarding any cmdlet.
- Find similar commands.
- Find a particular file or directory.
- Read the contents of a file.
- Find information about all services.
- Find information about all processes.
- Set the Execution Policy.
- Copy a file or a directory.
- Delete a file or a directory.
1] Launch a UWP Application¶
PowerShell offers a straightforward way to launch Universal Windows Platform (UWP) applications using their URI (Uniform Resource Identifier) scheme. Many built-in Windows applications and some third-party UWP apps can be opened directly using the Start-Process cmdlet followed by their specific URI. This method is particularly useful for scripting or quickly accessing settings pages or specific app functions without navigating through the Start menu.
For example, to launch the Windows Settings app, you would use the command:
Start-Process "ms-settings:"
This command instructs PowerShell to start a new process using the provided URI. Different UWP apps and even specific sections within apps have unique URIs. For instance, ms-settings:network opens network settings, and ms-settings:system opens system settings. You can often find lists of supported URIs on Microsoft’s documentation website to launch various parts of the operating system directly. The Start-Process cmdlet is versatile and can also be used to open traditional executables, documents, or folders by providing their path instead of a URI.
2] Get Help Regarding Any Cmdlet¶
Understanding how to get help within PowerShell is perhaps the most crucial skill for any user, regardless of experience level. The Get-Help cmdlet is your primary resource for learning about other cmdlets, their parameters, and how to use them correctly. It provides detailed documentation directly within the console, meaning you don’t always need internet access to figure out a command.
You can use Get-Help in several ways to obtain different levels of information:
Get-Help # Provides help on the Get-Help cmdlet itself
Get-Help <command-name> # Displays a brief summary and syntax of the command
Get-Help <command-name> -Full # Shows detailed syntax, parameter descriptions, examples, and related commands
Get-Help <command-name> -Examples # Shows only the examples for the command
Get-Help <command-name> -Online # Opens the online help page for the command (requires internet)
Get-Help * # Lists all available help topics and cmdlets
Using Get-Help -Full is often the best way to get comprehensive information when you are unfamiliar with a cmdlet. It explains what each parameter does, its type, and whether it’s mandatory or optional. The -Examples switch is invaluable for seeing practical applications of the command, often providing copy-pasteable lines that you can adapt for your own needs. Regularly using Get-Help builds your confidence and significantly speeds up your learning curve in PowerShell.
3] Find Similar Commands¶
Finding the right cmdlet for a specific task can sometimes be challenging, especially with the vast number of commands available. The Get-Command cmdlet is designed to help you discover cmdlets, functions, aliases, and other types of commands available in your PowerShell session. You can use filters to narrow down your search and find commands relevant to your needs.
Get-Command is excellent for exploring the command space. Without any parameters, it lists a large number of available commands. To make this list manageable, you can use parameters like -Name or -CommandType:
Get-Command -Name *Service* # Finds all commands with "Service" in their name
Get-Command -Verb Get # Finds all commands starting with the verb "Get"
Get-Command -Noun Process # Finds all commands acting on "Process"
Get-Command -Name Get-*Item* # Finds commands like Get-Item, Get-ChildItem
Get-Command -CommandType Cmdlet # Lists only cmdlets
Get-Command -Module Microsoft.PowerShell.Management # Lists commands from a specific module
Using wildcards like * is very effective with the -Name parameter to find commands based on partial names or patterns. For instance, Get-Command *File* would list commands containing the word “File”. Combining Get-Command with other cmdlets using the pipe (|) allows for more complex filtering and analysis of available commands. This cmdlet is indispensable for discovering new commands and understanding the structure of PowerShell’s command set.
4] Finding a Particular File or Directory¶
Locating files and folders is a fundamental file system operation. In PowerShell, the Get-Item and Get-ChildItem cmdlets are used for this purpose. Get-Item is typically used to get information about a specific item (like a file or directory) at a given path, while Get-ChildItem is used to list the contents within a container item (like a directory). Get-ChildItem is arguably more frequently used for listing files and folders.
To list the contents of the current directory, you simply type:
Get-ChildItem
To list the contents of a specific directory, provide the path:
Get-ChildItem C:\Users\YourUsername\Documents
You can use wildcards and parameters to filter and search:
Get-ChildItem C:\Data\*.log # List all files ending with .log in C:\Data
Get-ChildItem C:\Users -Recurse -Include *.jpg # Find all JPG files recursively under C:\Users
Get-ChildItem C:\Temp | Where-Object {$_.LastWriteTime -gt (Get-Date).AddDays(-7)} # Find files in C:\Temp modified in the last 7 days
Get-ChildItem can also display hidden or system files using the -Hidden or -System parameters. The output of Get-ChildItem is an object for each item found, which means you can easily pipe it to other cmdlets for further processing, like filtering, sorting, or performing actions on the items. This object-oriented nature is a key difference between PowerShell and older command-line interfaces like CMD.
5] Read the Contents of a File¶
Viewing the content of a text file without opening it in a separate editor is a common requirement. The Get-Content cmdlet serves this purpose in PowerShell. It reads the content of a file and outputs it line by line or as a single block of text, depending on how you use it. This is particularly useful for quickly reviewing log files, configuration files, or scripts directly within the console.
To display the entire content of a file, you provide the path to the file:
Get-Content C:\Logs\MyApp.log
For large files, reading the entire content at once might not be ideal. Get-Content offers parameters to control how much content is read:
Get-Content C:\Logs\MyApp.log -TotalCount 10 # Read only the first 10 lines
Get-Content C:\Logs\MyApp.log -Tail 5 # Read only the last 5 lines
Get-Content C:\Logs\MyApp.log -Raw # Read the entire file as a single string (useful for binary files or specific encodings)
You can also specify encoding using the -Encoding parameter if the file is not standard ASCII or UTF-8. The output of Get-Content can be piped to other cmdlets for text processing, such as filtering lines containing specific words using Where-Object or Select-String. This cmdlet is a quick and efficient way to peek into files without needing a separate text viewer.
6] Find Information About All Services¶
Windows services are programs that run in the background, performing tasks necessary for the operating system or installed applications. Managing services is a common administrative task. The Get-Service cmdlet provides detailed information about the services installed on your computer, including their status (Running, Stopped) and startup type.
To list all services on your local machine, simply run:
Get-Service
This outputs a table listing the status, name, and display name of each service. You can get information about a specific service by name:
Get-Service -Name BITS # Get information about the Background Intelligent Transfer Service
Get-Service -DisplayName "Windows Update" # Get information using the display name
Get-Service can also be used with wildcards to find services matching a pattern:
Get-Service -Name *Remote* # Find services with "Remote" in their name
Once you have service objects, you can pipe them to other cmdlets to perform actions:
Get-Service | Where-Object {$_.Status -eq 'Running'} # List only running services
Get-Service -Name BITS | Stop-Service # Stop the BITS service
Get-Service -Name BITS | Start-Service # Start the BITS service
Other related cmdlets include Restart-Service, Suspend-Service, and Resume-Service, allowing for comprehensive management of system services directly from the PowerShell console.
7] Find Information About All Processes¶
Processes are instances of programs that are currently executing on your computer. The Task Manager provides a GUI view of processes, but Get-Process in PowerShell offers a more flexible and scriptable way to inspect and manage them. Get-Process can list all running processes and provide extensive details about each one, such as CPU usage, memory consumption, process ID (PID), and the path to the executable.
To list all running processes on your system, execute:
Get-Process
This will show a table similar to the Task Manager’s process list, but often with more columns visible by default. You can get information about a specific process by name or by its Process ID:
Get-Process -Name explorer # Get information about the explorer.exe process
Get-Process -Id 1234 # Get information about the process with PID 1234
Like Get-Service, Get-Process supports wildcards:
Get-Process -Name *chrome* # Find all processes related to Google Chrome
The output is rich in data and can be easily manipulated:
Get-Process | Sort-Object -Property CPU -Descending # List processes sorted by CPU usage (highest first)
Get-Process | Select-Object -Property Name, Id, WorkingSet # Display only Name, ID, and Memory Usage (WorkingSet)
Get-Process -Name notepad | Stop-Process # Stop all instances of notepad.exe
Get-Process -Name explorer | Restart-Process # Restart the explorer.exe process (useful for resolving desktop issues)
Using Stop-Process can be powerful but should be done cautiously, as stopping critical system processes can lead to instability or system crashes. Always confirm the process you intend to stop.
8] Setting the Execution Policy¶
PowerShell’s execution policy is a security feature that controls the conditions under which PowerShell loads configuration files and runs scripts. This helps prevent the execution of malicious scripts. Understanding and sometimes adjusting the execution policy is necessary if you plan to run scripts downloaded from the internet or written by yourself.
The Set-ExecutionPolicy cmdlet allows you to change the policy. There are several levels of execution policy:
- Restricted: (Default on Windows client OS) No scripts can be run. Only individual commands are allowed.
- AllSigned: Scripts can run, but only if they are signed by a trusted publisher. Requires all scripts, including local ones, to be signed.
- RemoteSigned: (Default on Windows Server OS) Scripts downloaded from the internet must be signed by a trusted publisher. Local scripts do not require a digital signature. This is a common policy for users who run scripts they write themselves but want protection from untrusted downloaded scripts.
- Unrestricted: All scripts can run. Requires confirmation before running scripts downloaded from the internet. This is the least secure option.
- Bypass: Nothing is blocked and no warnings are given. Intended for specific scenarios without security checks.
- Undefined: Removes the currently assigned policy from the current scope.
To set the execution policy, you would use the cmdlet followed by the desired policy level. You might need to run PowerShell as an administrator to change the policy for all users.
Set-ExecutionPolicy RemoteSigned -Scope CurrentUser # Set policy for the current user only
Set-ExecutionPolicy Unrestricted -Scope LocalMachine # Set policy for all users (requires elevation)
You can check the current execution policy using Get-ExecutionPolicy. It’s important to choose a policy that balances security needs with usability. RemoteSigned is often a good compromise for individual users who write their own scripts.
9] Copy a File or a Directory¶
Copying files and directories is a frequent task. The Copy-Item cmdlet in PowerShell provides a flexible way to perform these operations, supporting single items, multiple items, and recursive copying of directories. Unlike the copy command in CMD, Copy-Item works with objects, making it easier to integrate into more complex scripting scenarios.
The basic syntax requires the path of the item(s) to copy and the destination path:
Copy-Item -Path "C:\Source\File.txt" -Destination "D:\Backup\" # Copy a single file
Copy-Item -Path "C:\Source\*" -Destination "D:\Backup\" # Copy all items in C:\Source to D:\Backup
Copy-Item -Path "C:\Source\Folder" -Destination "D:\Backup\" -Recurse # Copy a folder and its contents recursively
Copy-Item -Path "C:\Source\File1.txt", "C:\Source\File2.txt" -Destination "D:\Backup\" # Copy multiple specific files
You can use parameters like -Force to overwrite existing items at the destination without prompting or -Container to ensure the destination folder itself is created if it doesn’t exist. Copy-Item is a reliable and powerful tool for managing your file system structure from the command line.
10] Delete a File or a Directory¶
Just as you can copy items, you can also delete them using PowerShell. The Remove-Item cmdlet is used to delete files, folders, registry keys, and other items. It’s a powerful command, and caution should be exercised when using it, especially with parameters that bypass confirmation prompts.
The basic syntax is straightforward: provide the path to the item you want to remove:
Remove-Item -Path "C:\Temp\OldFile.txt" # Delete a specific file
Remove-Item -Path "C:\Temp\OldFolder" # Delete an empty folder
Remove-Item -Path "C:\Temp\OldFolder" -Recurse # Delete a folder and all its contents
Remove-Item -Path "C:\Temp\*" # Delete all contents within C:\Temp (but not C:\Temp itself)
By default, Remove-Item might prompt you for confirmation, especially when deleting multiple items or recursively deleting folders. You can suppress these prompts using the -Force parameter, but this increases the risk of accidentally deleting important data. It’s often safer to use -Confirm to explicitly require confirmation for each deletion, or -WhatIf to see what items would be deleted without actually performing the action.
Remove-Item -Path "C:\Important\Folder" -Recurse -WhatIf # See what would be deleted without deleting
Remove-Item -Path "C:\Important\Folder" -Recurse -Confirm # Require confirmation for each step of deletion
Remove-Item -Path "C:\Important\Folder" -Recurse -Force # Delete without prompting (USE WITH EXTREME CAUTION)
Always double-check the path before executing Remove-Item, especially when using -Recurse and -Force.
Running PowerShell Commands and Scripts¶
Executing commands in PowerShell is simple: type the command at the prompt and press Enter. Cmdlets like Get-Service or Get-Process run immediately. If a cmdlet requires parameters, you provide them after the cmdlet name, often preceded by a hyphen (e.g., -Name).
Running PowerShell scripts (.ps1 files) involves a few extra steps, primarily due to the execution policy mentioned earlier. First, you need to ensure your execution policy allows script execution (e.g., RemoteSigned or Unrestricted). Second, to run a script located in the current directory, you usually need to prepend ./ to the script name to indicate it’s in the current path, for security reasons.
- Open PowerShell (you might need to run as administrator for some scripts).
- (Optional) Navigate to the script’s directory using
Set-Locationorcd:
Set-Location -Path "C:\Scripts" # or cd C:\Scripts - Execute the script:
.\MyScript.ps1 # Execute script in the current directory C:\Path\To\MyScript.ps1 # Execute script using its full path
If the script requires parameters, you pass them after the script name, similar to cmdlet parameters. Understanding how to run scripts is key to automating complex workflows.
Getting a List of All PowerShell Commands¶
As mentioned earlier, the Get-Command cmdlet is your primary tool for listing available commands. PowerShell has thousands of cmdlets, functions, aliases, and other command types available by default or loaded via modules.
To get a comprehensive list, use:
Get-Command
This output can be quite long. To find specific types of commands, use filtering:
Get-Command -CommandType Cmdlet # List only Cmdlets
Get-Command -CommandType Alias # List only aliases
Get-Command -Verb Get -Noun *Item* # Find commands like Get-Item or Get-ChildItem
You can also save the output to a file for later review or analysis:
Get-Command | Out-File C:\Temp\AllPowerShellCommands.txt
This creates a text file containing the list of commands. For more structured data, you could export it to a CSV:
Get-Command | Export-Csv C:\Temp\AllPowerShellCommands.csv -NoTypeInformation
This CSV file can then be opened in applications like Microsoft Excel for sorting, filtering, and categorization, which is a great way to explore the breadth of PowerShell’s capabilities.
Understanding Cmdlets: The Building Blocks¶
At the core of PowerShell are cmdlets. These are lightweight commands used in the PowerShell environment. Cmdlets are not standalone executables but are implemented as .NET classes. This design choice is what gives PowerShell its object-oriented nature. When a cmdlet outputs data, it typically outputs objects, not just raw text. These objects have properties and methods that can be accessed and manipulated by subsequent cmdlets in a pipeline.
The consistent “Verb-Noun” naming convention (Get-Process, Set-Location, New-Item) makes cmdlets predictable and easier to discover. The verb indicates the action, and the noun indicates the object being acted upon. This structure, combined with detailed built-in help (Get-Help), significantly lowers the learning curve compared to older shell environments where command names and syntax could be highly inconsistent.
This object-based approach is a major distinction between PowerShell and command-line interpreters like the traditional Windows Command Prompt (CMD).
CMD vs PowerShell: A Brief Comparison¶
While both CMD and PowerShell are command-line interfaces available on Windows, they are fundamentally different and designed for different purposes. CMD is a legacy shell dating back to MS-DOS, primarily designed for executing simple commands and batch files. PowerShell, on the other hand, is a modern, task-based command-line shell and scripting language built on the .NET framework, designed for system administration, automation, and configuration management.
Here’s a comparison of key differences:
| Feature | Command Prompt (CMD) | PowerShell |
|---|---|---|
| Foundation | Legacy (MS-DOS based) | .NET Framework |
| Output | Text-based | Object-based |
| Commands | Simple internal commands, external executables (.exe, .com, .bat) |
Cmdlets (.NET objects), functions, aliases, external executables, scripts (.ps1) |
| Scripting | Batch scripting (.bat, .cmd) - limited functionality |
PowerShell scripting (.ps1) - powerful, structured, object-oriented |
| Piping | Pipes text output (command1 | command2) |
Pipes objects (cmdlet1 | cmdlet2) |
| Syntax | Varies by command, less consistent | Verb-Noun consistency, parameter-based |
| Extensibility | Limited | Highly extensible via modules |
| Remote Access | Basic remote execution (e.g., psexec) |
Built-in remoting capabilities (PowerShell Remoting) |
| Error Handling | Basic | More robust and structured |
The object-based nature of PowerShell is its most significant advantage. When you run Get-Process, it doesn’t just output text; it outputs a collection of Process objects. Each object has properties like Name, Id, CPU, Memory, etc. You can access these properties and methods directly and pipe the objects to other cmdlets that can process these object types. For example, Get-Process | Where-Object {$_.CPU -gt 50} filters the objects where the CPU property is greater than 50, rather than trying to parse text output.
For simple, everyday tasks like navigating directories (cd), creating folders (mkdir), or running .exe files, CMD might suffice. However, for automation, system management, getting detailed system information, or performing complex operations, PowerShell is the vastly superior and recommended tool.
Expanding Your PowerShell Skills¶
The ten cmdlets discussed here are just the tip of the iceberg. PowerShell is a deep and versatile tool. As you become more comfortable with these basic commands, explore piping (|) to connect cmdlets and the Where-Object and Select-Object cmdlets to filter and format command output. Learn about variables ($), loops (for, foreach), conditional statements (if), and functions to write more complex scripts.
Understanding PowerShell modules is also important, as they contain sets of related cmdlets. Modules for managing Active Directory, Azure, Microsoft 365, and many other systems can be installed, extending PowerShell’s capabilities significantly.
Here is a YouTube video that provides a basic introduction to PowerShell concepts, which might be helpful for beginners:
<iframe width="560" height="315" src="https://www.youtube.com/embed/0JOyQk8d31U" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
Please note: The actual video content depends on the embed source.
PowerShell is an essential skill for anyone looking to gain deeper control over their Windows environment, automate repetitive tasks, or pursue a career in IT administration. Starting with these ten fundamental commands is an excellent way to begin your journey.
Do you have any other essential PowerShell cmdlets or tips you’d like to share? Feel free to write them down in the comment box below.
Post a Comment