What is PowerShell? How to use PowerShell effectively on a computer.

PowerShell is a command-line program that is gradually becoming the default on Windows 10, replacing the outdated CMD. However, PowerShell is still a relatively new program for computer users. Taimienphi will introduce you to PowerShell and how to use it effectively.

PowerShell was developed to replace the familiar command-line program CMD on Windows, which uses Windows Command Prompt (.cmd and .bat) files and very basic commands to handle simple tasks. PowerShell runs in the .NET environment and the .NET Framework, which includes commands and coding languages.

Alongside PowerShell, Windows also developed Windows PowerShell ISE. ISE stands for Integrated Programming Environment, which includes a graphical interface for advanced programming and integrates various tools to help you avoid typing all commands on a single command line.

Windows PowerShell has been under development by Microsoft for quite some time; however, the newer version with many improved features was only introduced in Windows 8.1 and Windows Server 2012.

How to start PowerShell

Press the Windows + R key combination, then type ' powershell ' to open the Windows PowerShell interface.

PowerShell Script

To use PowerShell effectively, we need a clear understanding and specific examples of PowerShell, along with a distinction between PowerShell and CMD. Because PowerShell is developed on the .NET framework, it can be called an object-oriented language.

As you know, the DIR command is a common command in the command prompt that lists all files and directories within a parent directory. The listed information includes the last updated date and time, and details of each file.

In PowerShell , entering the DIR command also has a similar function; however, here, DIR only serves as a shorthand for the standard command, Get-ChildItem.

Some basic PowerShell commands

Get Help

This tutorial allows users to learn about the basic syntax of commands used in Windows PowerShell.

For example: If the user wants to check the syntax of Get Process , they would type the command.

Get-Help -Name Get-Process

Similarly, when users want to list all commands related to Get, they would type the command.

Get-Help -Name Get-*

Get-Service

This command lists all services currently running and installed on the system.

If you need to learn more about any service, add -Service Name after the Get-Service command.

ConvertTo-HTML

When you need to view system information in the most visual way, you can use the ConvertTo-HTML command to export the information to an HTML file located on your hard drive partition.

The command template is as follows:

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

Get-Service : This means you will output the information of the running service in HTML format. You can also replace "Service" with the information you want, as shown in the command examples listed in the Get Help section above.

X : Hard drive partition name

Filename : The file name you choose.

For example, to export information about a running service to the file Taimienphi-service.htm located on partition D:Taimienphi, you would type the command:

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

This is the content of the extracted file.

Export-CSV

Similar to extracting information to an HTML file, PowerShell also allows you to export information to a CSV spreadsheet. The command is as follows:

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

Get-Service : This means you will output the information of the running service in HTML format. You can also replace "Service" with the information you want, as shown in the command examples listed in the Get Help section above.

X : Hard drive partition name

Filename: A file name of your choice.

For example, to export information about a running service to the file Taimienphi-service.csv located on partition D:Taimienphi , you would type the command:

Get-Service | Export-CSV D:TaimienphiTaimienphi-service.csv

This is the content of the extracted file.

Get-EventLog

This command allows the user to look up system changes through log files. The user can use this command.

Get-EventLog -Log "Application"

To view the application change log.

Get-Process

With this command, users can list the processes currently running on the computer. Actions such as extracting HTML files, CSV files, and getting event logs can all be applied to this `get process` command.

Above is some basic information about PowerShell. You can read and learn more about this new command-line program to use for your work. Besides the functions mentioned above, PowerShell can also be used to create Restore Points on Windows 10 using PowerShell commands to help restore your computer in case of errors. For detailed instructions on creating Restore Points, you can follow the guide on TipsMake.

Using PowerShell to TRIM an SSD on Windows 10 is a common method used by many to maintain performance and extend the lifespan of their SSDs. Refer to this link for instructions on how to TRIM an SSD using PowerShell.


Additionally, with PowerShell, you have another way to view the weather on your computer. Details on how to view the weather on Windows 10 using PowerShell can be found here.

Other System articles
  • The difference between Command Prompt and Windows PowerShell

    the two most common commands are command prompt and powershell. while they may look similar on the surface, they are actually quite different. there are many differences between command prompt and powershell.
  • Run CMD with administrator privileges on Windows 7, 8, 8.1, and 10.

    when you open cmd with administrator privileges on a windows computer, you can execute all commands that require administrator privileges. there are many ways to open command prompt as administrator on windows; below, tipsmake will guide you on how to open and run cmd with administrator privileges on windows 7, xp, windows 8/8.1, and windows 10.
  • Commonly used CMD commands on Windows

    the most commonly used and popular cmd commands on windows are useful for network administrators and it students, both at home and in businesses, when troubleshooting or checking network or computer system problems. this article explains the meaning and usage of cmd commands on a computer.
  • CMD commands, Command Prompt commands in Windows 7 and 8

    the cmd command is used to access folders in windows quickly. some people also use the command prompt to ping networks, check hardware information, etc., of their computer. there are many different cmd commands; this article will summarize the most commonly used cmd or dos commands (windows 98, windows 95, and ms-dos).
  • How to use the Ping command on a computer

    you can easily check your internet connection without using any software by using the ping command. tipsmake will guide you through the detailed steps of checking your network using the ping command in the content below.
  • 6 Ways to Open CMD on Windows 7, Detailed Instructions

    command prompt (cmd) is a command-line tool on windows 7 that allows for quick system operations. you can open cmd in various ways, such as using the start menu, run, or task manager, to easily execute commands for system checks and management.
Category

System

Windows XP

Windows Server 2012

Windows 8

Windows 7

Windows 10

Wifi tips

Virus Removal - Spyware

Speed ​​up the computer

Server

Security solution

Mail Server

LAN - WAN

Ghost - Install Win

Fix computer error

Configure Router Switch

Computer wallpaper

Computer security

Mac OS X

Mac OS System software

Mac OS Security

Mac OS Office application

Mac OS Email Management

Mac OS Data - File

Mac hardware

Hardware

USB - Flash Drive

Speaker headset

Printer

PC hardware

Network equipment

Laptop hardware

Computer components

Advice Computer

Game

PC game

Online game

Mobile Game

Pokemon GO

information

Technology story

Technology comments

Quiz technology

New technology

British talent technology

Attack the network

Artificial intelligence

Technology

Smart watches

Raspberry Pi

Linux

Camera

Basic knowledge

Banking services

SEO tips

Science

Strange story

Space Science

Scientific invention

Science Story

Science photo

Science and technology

Medicine

Health Care

Fun science

Environment

Discover science

Discover nature

Archeology

Life

Travel Experience

Tips

Raise up child

Make up

Life skills

Home Care

Entertainment

DIY Handmade

Cuisine

Christmas

Application

Web Email

Website - Blog

Web browser

Support Download - Upload

Software conversion

Social Network

Simulator software

Online payment

Office information

Music Software

Map and Positioning

Installation - Uninstall

Graphic design

Free - Discount

Email reader

Edit video

Edit photo

Compress and Decompress

Chat, Text, Call

Archive - Share

Electric

Water heater

Washing machine

Television

Machine tool

Fridge

Fans

Air conditioning

Program

Unix and Linux

SQL Server

SQL

Python

Programming C

PHP

NodeJS

MongoDB

jQuery

JavaScript

HTTP

HTML

Git

Database

Data structure and algorithm

CSS and CSS3

C ++

C #

AngularJS

Mobile

Wallpapers and Ringtones

Tricks application

Take and process photos

Storage - Sync

Security and Virus Removal

Personalized

Online Social Network

Map

Manage and edit Video

Data

Chat - Call - Text

Browser and Add-on

Basic setup