PowerShell basic commands

Basics of PowerShell:

Windows PowerShell is a command line tool from Microsoft to facilitate the system administrators or a developer to interact with the system. When we say it is a command line tool, it means that the user interacts with the system through set of commands. We can relate the Windows PowerShell to the UNIX shells such as C-shell or BASH etc.

What is the use of PowerShell:

Windows PowerShell is one of great tools to the System Administrators. The administrators can write scripts using PowerShell commands to automate the repetitive administrative tasks, hence reducing the effort of manual work. Also, PowerShell provides a rich set of commands which can be used to do not just system administration but a variety of tasks too.

So let’s get our hands on Windows PowerShell.

In your Windows OS go to RUN-> type PowerShell and hit enter. You will get a console window.


Here you can see that we have given a ‘Get-Date’ command and we received the current date-time as the output. So we instructed PowerShell with a command and we got a result.

#Clear the screen
#Get all PowerShell commands
#If you want to check the commands with the word “history”
Get-Command -Noun *history*
#Close all windows explorer and Internet explorer
Get-Process *explore* | Stop-Process
#Lock your computer
$shell = New-Object -com "Wscript.Shell"
$shell.Run("%windir%\System32\rundll32.exe user32.dll,LockWorkStation")
#Shutdown computer

For details about PowerShell, please watch the below video
PowerShell Basics – Part 1

To get more script visit the below site:

Reference : https://technet.microsoft.com/en-us/scriptcenter/powershell.aspx

Read More