Clear, practical technology insights BSOD Code Lookup · Windows Error Code Lookup · Wi-Fi Troubleshooting · PC Troubleshooting Checklist

What Is PowerShell Basic Commands in PowerShell

Learn what PowerShell Basic Commands in PowerShell means, why it matters, how it works, and how to evaluate or use it effectively with clear examples.

Table of Contents

This guide explains PowerShell Basic Commands in PowerShell, why it matters, how it works, and how to evaluate or use it in practical situations.

What Is PowerShell Basic Commands in PowerShell screenshot

1. What is PowerShell?

To better understand PowerShell we first need to know what Shell is. In computer science, the shell is basically a user interface that gives you access to various Supported operating systems services. A shell may be command line based or it may include a graphical user interface (GUI).

Windows PowerShell is a shell developed by Microsoft for the purpose of automating and configuring tasks. PowerShell will work on. NET and. NET Framework environments including commands and coding languages.

In parallel with PowerShell, Windows has developed Windows Power Shell ISE. ISE stands for integrated coding environment including graphical user interface for advanced programmers and integrates various tools to help you without having to enter all the commands on a single command line.

Windows PowerShell has been in development for a long time by Microsoft, but a new version with improved features has been introduced since Windows 8.1 and Windows Server 2012.

On Windows 10 you can open PowerShell by right-clicking on the Windows icon and selecting Windows PowerShell or Windown PowerShell (Admin)

1. What is PowerShell? screenshot 2

PowerShell interface:

1. What is PowerShell? screenshot 3

2. Basic commands in PowerShell

- Get Help

This command lets users learn basic syntax and information about commands used in Windows PowerShell.

For example: If the user wants to know what the Get Process command is and how the syntax is, you will type the command

Get-Help -Name Get-Process

- Get Help screenshot 4

Similarly, when a user wants to list all Get related statements, you will type the command

Get-Help -Name Get- *

- Get Help screenshot 5

- Get-Service

This command will list all services running and installed on the system.

- Get-Service screenshot 6

If you need to learn more about any of these services, you can add the -Service name after the Get-Service statement

- ConvertTo-HTML

When you need to see the system information in the most intuitive way, you can use the ConvertTo-HTML command to export the information into an html file located on the hard drive partition.

The sample command is as follows:

Get-Service | ConvertTo-HTML -Property Name, Status> C: filename. htm

Get-Service: It means that you will output the Service information running into HTML, you can also replace the Service with the information you want according to the command form listed in the Get Help section above.

C: The name of the hard drive partition

Filename: The file name you set

For example: Export the running information to TTPM-service. htm file located in D: Thuthuatphanmem partition, you will type the command:

Get-Service | ConvertTo-HTML -Property Name, Status> D: ThuthuatphanmemTTPM-service. htm

- ConvertTo-HTML screenshot 7

We will get an HTML file as shown:

- ConvertTo-HTML screenshot 8

Here is the content of the html file:

- ConvertTo-HTML screenshot 9

- Export-CSV

Similar to extracting information into an HTML file, PowerShell also lets you export information to an Excel file. The statement is as follows:

Get-Service | Export-CSV X: filename. csv

Get-Service: It means that you will output the Service information running into HTML, you can also replace the Service with the information you want according to the command form listed in the Get Help section above.

X: Name of hard drive partition

Filename: The file name you set

- Export-CSV screenshot 10

- Get-EventLog

The command lets you look up changes in the system through the log file. User can use the command

Get-EventLog -Log "Application"

To look up the Application change log

- Get-Process

With this command, the user can list Processes running on the computer. Actions to extract html file, csv file, get event log can be applied to this get process command

- Get-Process screenshot 11

- Stop-Process:

Sometimes, there are services in the system that are 'suspended'. For such cases, use the Get-Process command to determine the exact name or ID of the process, and turn off the process with the Stop-Process command. For example, to turn off NotePad activity, type the following command:

Stop-Process -Name notepad

Above is an introduction to PowerShell and basic commands used in PowerShell. Hopefully through the article you will know more about the PowerShell command line interface and know how to use it. Thank you for watching!

FAQ

What should I know about PowerShell Basic Commands in PowerShell?

Focus on the key features, requirements, limitations, and practical use cases explained in this guide.

How do I get the best results with PowerShell Basic Commands in PowerShell?

Follow the recommended steps, use current software or information, confirm compatibility, and review settings before major changes.

Are there any risks or limitations?

Potential limitations depend on compatibility, data quality, cost, privacy, support, and how the product or method is used.

Discussion

Reader Comments 0

Sign in with email or Google to join the discussion.