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.

1. Get-Help

get help get process powershell command
image credit - self captured (Tashreef Shareef)

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:

 Get-Help Get-Process 

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

Alternatively, you can use the Get-Help -online command to get help for a PowerShell cmdlet online. For example, to view Microsoft's online documentation for the Get-Content cmdlet, type:

 Get-Help Get-Content -online 

2. Get-Process

get process powershell command
image credit - self captured (Tashreef Shareef)

The Get-Process command helps you retrieve and show a list of all the active system processes with their identifiers (IDs). You can use it as an efficient alternative to Windows Task Manager to 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 

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:

 Get-Process -ID 20496 | Stop-Process 

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

3. Start-Process

start process notepad
image credit - self captured (Tashreef Shareef)

You can use the Start-Process cmdlet 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:

 Start-Process notepad  

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

 Start-Process -FilePath "notepad" -Verb runAs 

4. Get-Command

get process powershell command 1
image credit - self captured (Tashreef Shareef)

The Get-Command lets you view all the PowerShell commands installed on your computer. Similar to Get-Help, you can 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 can specify parameters to find features with a specific name and CommandType. For example, to find cmdlets (CommandTypes) that start with A (Name), type:

 Get-Command -Name A* -CommandType cmdlet 

Alternatively, type Get-Help Get-Command -Examples to view more examples.

5. Get-Service

get service command powershell
image credit - self captured (Tashreef Shareef)

The Get-Service cmdlet 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 can 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:

 Get-Service -Name "Win*" 

6. Get-ChildItem

get childitem powershell command 1
image credit - self captured (Tashreef Shareef)

You can use PowerShell to search through directories. The Get-ChildItem command 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:

 Get-ChildItem "C:\" 

Additionally, use the -Path parameter 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:

 Get-ChildItem -Path "C:\Program Files" 

Additionally, use the -Recurse parameter to view all the files in the specified folder and the -Name parameter to view item names in a directory.

 Get-ChildItem -Path "C:\Program Files\Fodler_Name" -Recurse | Select FullName 

In the above command, replace sub-folder with the folder name to view its content.

7. Copy-Item

copy item powershell command
image credit - self captured (Tashreef Shareef)

The Copy-Item cmdlet lets you copy-paste files and folders and their contents to a different directory. To copy files and folders, type Copy-Item followed by the source -Path, -Destination parameter, and destination address. For example, to copy E:\Folder1 and its contents to E:\Folder2, type:

 Copy-Item "E:\Folder1" -Destination "E:\Folder2" -Recurse 

Note that the -Recurse parameter 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

move item powershell command
image credit - self captured (Tashreef Shareef)

Similarly, to move an item, you can use the Move-Item cmdlet. For example, to move the folder, files, sub-folders, and all its contents to your specified destination, type:

 Move-Item -Path "E:\Folder1" -Destination "E:\Folder2"  

9. Remove-Item

remove item powershell command
image credit - self captured (Tashreef Shareef)

The Remove-Item cmdlet 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:

 Remove-Item E:\Folder1\Test.txt 

10. Get-Content

get content powershell command
image credit - self captured (Tashreef Shareef)

The Get-Content cmdlet 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:

 Get-Content "E:\Folder1\Test.txt" 

You can further specify the content length to view using the -TotalCount parameter.