What is PowerShell Basic commands in PowerShell
Surely every computer user knows or has at least used the Command Prompt or CMD, but when it comes to PowerShell, not everyone knows it. First of all, to understand it briefly, PowerShell is a command-line interface similar to CMD, it can do everything CMD can do and even more. PowerShell is gradually becoming the default on Windows 10 instead of the outdated CMD, but PowerShell is still a strange program for ordinary computer users. In the following article, TipsMake.com will answer you the question of what is Powershell and some of your basic commands in Powershell, please refer.
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 operating system 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)
PowerShell interface:
2. Basic commands in PowerShell
- Get Help
This command allows users to 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
Similarly, when a user wants to list all Get related statements, you will type the command
Get-Help -Name Get- *
- Get-Service
This command will list all services running and installed on the system.
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
We will get an HTML file as shown:
Here is the content of the html file:
- Export-CSV
Similar to extracting information into an HTML file, PowerShell also allows you to 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
- Get-EventLog
The command allows you to 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
- 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!
You should read it
- PowerShell command in Windows
- Use PowerShell to download any file on Windows 10
- How to use PowerShell's default parameter to change the command behavior
- 10 useful basic PowerShell commands for Windows
- How to install PowerShell 7.0 in Windows 10/8/7
- How to Run Powershell
- Microsoft Windows PowerShell and SQL Server 2005 SMO - Part 2
- How to check PowerShell version in Windows 10
May be interested
- How to enter Safe Mode on Windows 7how to enter safe mode on windows 7. safe mode is a great rescue mode when the computer encounters emergencies but not to the point of having to use the backup system partition or have to reinstall the entire system. here tipsmake.com will postpone
- How to delete cached DNS on the computer using the Flush DNS commandhow to delete cached dns on the computer using the flush dns command. when a dns system works, it stores cached data about the website and ip addresses associated with them. clear the dns cache to let dns update the new ip for more accurate and efficient access.
- How to check computer hardware information using AIDA64how to check computer hardware information using aida64. to view information about computer hardware, aida64 is one of the best software. aida64 also displays information about software, windows updates, software copyright information. also aida64
- What is the registry? How to open, edit, delete, back up the Registrywhat is the registry? how to open, edit, delete, back up the registry. if you are an it geek who likes technology and likes to mess with computers, then you probably already know the registry or even edit them. however, whether you know what the registry is or not, how to use it
- How to recover, retrieve deleted files in trashhow to recover, retrieve deleted files in trash. in the course of using the computer, you have probably encountered a case of mistakenly deleting data. if you are in that case, don't worry, because when we delete a file in windows, the file
- How to check win 32bit or 64bit like on windows 7, 10how to check 32bit or 64bit win on windows 7, 10. when we install a new software on the computer, you will see on the software download page that usually has 2 versions of 32 bit and 64 bit and you must install software that is compatible with your windows