The 16 Best PowerShell Commands (Cmdlets) You Must Know

Most of us prefer PowerShell due to its automation capabilities. It’s a command-line shell with a fully developed scripting language. You can use the built-in cmdlets or write your own script to automate the administrative tasks of Windows and other compatible operating systems. It allows you to do everything that you can do with the GUI apps and more.

However, mastering the functionality and flexibility of PowerShell involves a steep learning curve. If you are just getting started with PowerShell, here are the essential commands you can learn to master this scripting language in the long run.

4

1. Get-Help

Get-Help, as the name suggests, is part of PowerShell’s integrated help system. It helps you find necessary information for the command, concepts, and functions, identify alias, scripts, and more.

To get help for a PowerShell cmdlet, you need to use the Get-help cmdlet followed by a cmdlet name. For example, to view the synopsis and syntaxes associated with the get-process cmdlet, type:

powershell best commands cmdlets

This command can read both comment-based and XML-based help provided by the function author.

Alternatively, you’re able to use theGet-Help -onlinecommand to get help for a PowerShell cmdlet online. For example, to view Microsoft’s online documentation for theGet-Contentcmdlet, type:

get help get process powershell command

2. Get-Process

TheGet-Processcommand helps you retrieve and show a list of all the active system processes with their identifiers (IDs). you’re able to use it as anefficient alternative to Windows Task Managerto view, stop and restart system processes.

For example, if you need to stop the GameBar process, first you need to find the process ID associated with it. So, type:

get process powershell command

This command will show all the running system processes. Next, find the ID associated with the process you want to stop. To stop the process, type:

Here-ID 20496is the ID of the process (GameBar) you want to stop.

start process notepad

3. Start-Process

You can use theStart-Processcmdlet in PowerShell to start one or more processes on a local computer. To use the cmdlet, type Start-Process followed by the process name. For example, if you want to start a new notepad process, type:

Additionally, you could use the parameters of Start-Process to specify options. For example, if you need to launch a process as administrator, type:

4. Get-Command

TheGet-Commandlets you view all the PowerShell commands installed on your computer. Similar to Get-Help, you could use the Get-Command followed by a search query to find commands for a specific feature.

Since the Get-Command displays all the commands, you could specify parameters to find features with a specific name and CommandType. For example, to find cmdlets (CommandTypes) that start with A (Name), type:

Alternatively, typeGet-Help Get-Command -Examplesto view more examples.

5. Get-Service

TheGet-Servicecmdlet lets you view your computer’s status and list of services. By default, the Get-Service command returns all the (stopped and running) services.

you may use the parameters to specify and find services depending on their status, name, and dependent services. For example, to view all the services starting with the name Win, type:

6. Get-ChildItem

You can use PowerShell to search through directories. TheGet-ChildItemcommand is a handy cmdlet to look for folders and files and quickly perform content-based searches without using File Explorer.

To view all the top-level folders in the C:\ directory, type:

Additionally, use the-Pathparameter to view a particular folder, sub-folders, and content. For example, to view all the sub-folders and files in the Programs Files folder, type:

Additionally, use the -Recurseparameter to view all the files in the specified folder and the-Nameparameter to view item names in a directory.

In the above command, replacesub-folderwith the folder name to view its content.

7. Copy-Item

TheCopy-Itemcmdlet lets you copy-paste files and folders and their contents to a different directory. To copy files and folders, typeCopy-Itemfollowed by the source -Path,-Destinationparameter, and destination address. For example, to copyE:\Folder1and its contents toE:\Folder2, type:

Note that the-Recurseparameter in the above command is responsible for moving all the folder contents. Without it, PowerShell will only copy the top-level folder (Folder1) and files specified in the command.

8. Move-Item

Similarly, to move an item, you may use theMove-Itemcmdlet. For example, to move the folder, files, sub-folders, and all its contents to your specified destination, type:

9. Remove-Item

TheRemove-Itemcmdlet lets you delete files, folders, functions, and other data types from the specified directory. For example, to delete the Test.txt file in the E:\Folder1 folder, type:

10. Get-Content

TheGet-Contentcmdlet lets you view the content of an item item without using a text editor. For example, to retrieve the contents of the Test.txt file, type:

you could further specify the content length to view using the-TotalCountparameter.

The command prompt is still a powerful Windows tool. Here are the most useful CMD commands every Windows user needs to know.

Not Linux, not Windows. Something better.

My foolproof plan is to use Windows 10 until 2030, with the latest security updates.

One casual AI chat exposed how vulnerable I was.

These are the best free movies I found on Tubi, but there are heaps more for you to search through.

When your rival has to bail out your assistant.

Technology Explained

PC & Mobile