PowerShell

10 basic PowerShell commands that every Windows 10 user should know

10 basic PowerShell commands that every Windows 10 user should know

Windows PowerShell is powerful and can do almost everything that a person wants on his computer. But the only problem is that it is a command line tool and does not have GUI. However, it can be helpful when the GUI based interface fails or stops responding. The main thing unfortunately is the fact that a normal user lacks the knowledge of using PowerShell to its full potential. But today, we will be trying to discuss the top 10 PowerShell commands that can help a user do more on Windows 10.

PowerShell commands that will help a user do more

Before we begin, it is needed to be highlighted that some of these cmdlets might toggle certain settings or configuration on your computer. A cmdlet is a PowerShell script that performs a single function. So, to be on a safer side, create a System Restore point first. If something goes wrong during trying one of the following cmdlets, you can always restore your computer.

We will be taking a look at cmdlets that can do the following:

  1. Launch a UWP Application.
  2. Get Help regarding any cmdlet.
  3. Get similar commands.
  4. Find a particular file.
  5. Read the contents of a file.
  6. Find information about all the services on a computer.
  7. Find information about all the processes on a computer.
  8. Setting the Execution Policy.
  9. Copy a file or a directory.
  10. Delete a file or a directory.

1] Launch a UWP Application

PowerShell is a great tool which can be used to launch UWP Applications within seconds. But the main thing lies in the proper execution of a command. You can use

Start-Process "ms-settings:"

command just to launch the Windows Settings UWP Application. You can learn more about other URIs for other UWP Applications here on microsoft.com.

2] Get Help regarding any cmdlet

If you are ever stuck confused about what command you must be used to execute a specific task. Or what a specific cmdlet does, you do not need worry. You can just use the Get-Help cmdlet to do it. You can use it in the following ways-

Get-Help Get-Help  Get-Help  -Full Get-Help  -Example Get-Help *

Here, the first entry will guide you on how to use this cmdlet. The second entry will give you a simple summary of the particular cmdlet. The third entry will give detailed information about the respective cmdlet. The fourth entry will comprise of everything that the third cmdlet shows but will add an example of how to use that cmdlet. And finally, the fifth cmdlet will list every command that is available for your use.

3] Get Similar Commands

To find commands of a similar type or that contain a particular phrase in them, you can use the Get-Command cmdlet. However, it does not list out every cmdlet in PowerShell, so you make use of some particular filters. You can use the following commands-

Get-Command -Name  Get-Command -CommandType 

The first cmdlet will help you in finding a cmdlet with a particular phrase in it whereas the second one will enable you to filter out cmdlets that perform a particular function.

4] Finding a particular file

If you need to find a particular file or a directory in a particular location, you can use the Get-Item cmdlet. You can use it as

Get-Item 

to list out the contents of the particular path.

5] Read the contents of a file

If you need to read the contents of a file, you can use the Get-Content command as-

Get-Content 

6] Read information about all the services on a computer

You can use the Get-Service cmdlet to list all the services running or stopped on your computer. Alternatively, you can use the following related cmdlets to do their respective functions-

Start-Service  Stop-Service  Suspend-Service  Resume-Service  Restart-Service 

7] Read information about all the processes on a computer

Similar to the Get-Service cmdlet, you can use the Get-Process cmdlet to list all the Processes running on your computer. Alternatively, you can use the following related cmdlets to do their respective functions,

Start-Process  Stop-Process  Wait-Service 

8] Setting the Execution Policy

While there is support for creating and executing scripts on PowerShell, there are restrictions to each one of them as a part of some security measures. You can toggle the Security level to any of the 4 levels. You can use the Set-ExecutionPolicy cmdlet followed by any of the security levels given as-

Set-ExecutionPolicy Unrestricted Set-ExecutionPolicy All Signed Set-ExecutionPolicy Remote Signed Set-ExecutionPolicy Restricted

Here, the policies from top to bottom range from lowest to the highest level of security.

9] Copy a file or a directory

A user can make use of the Copy-Item cmdlet to copy one file or directory to another destination. The syntax for this cmdlet is-

Copy-Item "E:\TWCTest.txt" -Destination "D:\"

10] Delete a file or a directory

Similar to the Copy-Item cmdlet, A user can make use of the Copy-Item cmdlet to copy one file or directory to another destination. The syntax for this cmdlet is-

Remove-Item ""E:\TWCTest.txt""

Do you have any other useful cmdlets to share with all of us? Feel free to write them down in the comment box below.

"
Gry Najlepsze gry wiersza poleceń dla systemu Linux
Najlepsze gry wiersza poleceń dla systemu Linux
Wiersz poleceń jest nie tylko twoim największym sprzymierzeńcem podczas korzystania z Linuksa - może być również źródłem rozrywki, ponieważ możesz go ...
Gry Najlepsze aplikacje do mapowania gamepada dla systemu Linux
Najlepsze aplikacje do mapowania gamepada dla systemu Linux
Jeśli lubisz grać w gry na Linuksie za pomocą gamepada zamiast typowego systemu wprowadzania klawiatury i myszy, jest kilka przydatnych aplikacji dla ...
Gry Przydatne narzędzia dla graczy Linuksa
Przydatne narzędzia dla graczy Linuksa
Jeśli lubisz grać w gry w systemie Linux, prawdopodobnie używałeś aplikacji i narzędzi, takich jak Wine, Lutris i OBS Studio, aby poprawić wrażenia z ...