This is a PowerShell basics tutorial where we can learn what is PowerShell? How can we install PowerShell in Windows 7 machine? How can we start with PowerShell? And also we will see how to change PowerShell command window font, color, layout, etc.? Then we will discuss various PowerShell basic commands.
We will also see how can you use PowerShell in SharePoint Online or SharePoint 2013/2016.
What is PowerShell?
PowerShell is a scripting language or command-line Shell designed for the System Administrator. PowerShell is built on .Net Framework. The Windows PowerShell is useful for IT professionals to control and automate the administration of the Windows operating system and other applications.
PowerShell commands are called cmdlets is a lightweight command used in the Window base PowerShell environment. PowerShell invokes these cmdlets in the command prompt. We can create and invoke the PowerApps command using PowerShell APIS.
Download PowerShell for Window 7/8/10 Operating System
Windows PowerShell is installed by default in all windows operating systems like Windows 7 SP1, Windows 8, Windows 10, Windows Server 2008 R2 SP1, Windows Server 2012, Windows Server 2012 R2, Windows server 2016, etc.
But it will not have the updates. So you can follow this microsoft docs article to install the PowerShell updates.
How to Work with Windows PowerShell
We can run the PowerShell command by saving the file with .PS1 extension and double-click on it to run the command.
Search for PowerShell in Windows and you can see:
- Windows PowerShell (64 Bit version)
- Windows PowerShell (86) (32 bit version)
You should always use 64 bit version of Windows PowerShell

Then it will open the PowerShell command prompt.
Change PowerShell Command Window Properties
By default, PowerShell command prompt shows blue and white color. But we can easily change the font, color etc.
Right click on PowerShell icon. We will get a menu. Click on the “Properties”.

The Properties dialouge box contains 4 tab named as “Options”, “Font”, “Layout” and “Colors”. According to our requirment we can modify our configuration settings using these 4 tab.
Below screenshot is the PowerShell “Options” tab. The “Options” allow you to modify the properties of “Cursor Size”, “Command History”, “Edit Options”, “TextSelection”.
The most important properties we should know here is “QuickEditMode” and “InsertMode“. When we enable the “QuickEditMode” it allows the user to use the mouse for copy and paste command in the PowerShell console.
Like that the Purpose of the “InsertMode” is allow user to inserts new text into a line rather than overwriting it. When the “Enable Ctrl key shortcuts” option is enabled, we can play with the Keyboard shortcut in the PowerShell command prompt.
When the “filter clipboard content on paste” is enabled then contents paste from the clipboard to the command prompt, tabs are removed and smart quotes are converted to regular ones.

The PowerShell “Font” tab includes “font size”, “font style “. Here we can bold and unbold our text.


The PowerShell Layout tab includes buffer size, window size, and window position. The buffer size option allows the user to change the width(number of characters) and height(number of lines) of the buffer. The buffer size can be the same size or the larger size than the window size, but it can not be smaller than the
Like that the window size option allows the user to change the height and width of the console window. It can not be larger than the buffer size. The window position is displaying the position of PowerShell console window where we should place the console on our system.
According to our wish we can change the PowerShell console position here.

The below screenshot is the PowerShell “color tab” properties screen. From the PowerShell color tab we can change the “screen text” and “popup text”. We can also change the “Backgrouns color” and “popup background”.
To change the color select the catagoy for example background color or popup background, click on a color from the color bar. If you know the red, green and blue value for the color then enter the value in the “Seleccted color value” bar.
Click on OK. We can notice the change automatically in the PowerShell console window.

The below console window screen color is changed now.

One example how we run the script in the PowerShell. I have taken the “‘Get-Host” command here. Just type the command and cliked on enter for the out put. The Get-Host is giving the output details about the PowerShell enviroment. The Name, version and Instance and UI etc

One more example we will see how we will diplay the text in the PowerShell consolse window. When we run the below command then the text is display different look in the Output.
Write-Output “Welcome to PowerShell console window”
Write-Warning “This is a PowerShell warning message”
Write-Error “This is an error message”

What is PowerShell ISE?
The PowerShell ISE is a host application where we can run our PowerShell script. In the PowerShell ISE environment, we can run the command, write the command, test and debug script. We can use menu items and keyboard shortcuts to perform many of the same tasks that we can perform in window PowerShell console. For example, when we get the error when we run the code, we can set a line breakpoint in the script.
You can read below two tutorial to know more about Windows PowerShell ISE.
Where to run PowerShell commands?
The Window PowerShell Integrated Scripting Environment (ISE) is a host application for Windows PowerShell.
Go to the Window. Type PowerShell ISE in the search.
Select and Click on the PowerShell ISE and there you can run the PowerShell commands.
PowerShell Basics Commands
Here we will see some of PowerShell basic commands.
Get-help
This cmdlets will help us to how to give cmdlets and its parameter.

Get-Process
When we run the Get-Process cmdlets to know all the processes running on the local system.

Get-Service “vm*”
This cmdlet is used to get all the services which are started with the “VM” letter.

Get-Service “vm*”|Get-Member: In this cmdlets we combined two cmdlets. One is Get the service which start with the “VM” letter and then get member from the VM process.

$PSVersionTable
PowerShell has a built in variable called $PSVersionTable. When we run the variable is diplaying numeric information about the Version, Build and Compatiability.

$PSVersionTable.PSVersion
When we run the $PSVersionTable.PSVersion cmdlet, it will give all the details of “PSVersion”.

$Host
The Host inbuilt variable gets an object that represents the current host program.

Start-Transcript
The Start-Transcript is used to create a record of PowerShell session. It includes all the command user type and all the output which will appear in the console window.
We can see the output “The transcript is started” and the output will store in a text file. The text filr will be automatically created in the local system.

Now we will check the file is really created in the above address or not in our G drive. We can see the text file is created in the above location.

Get-Command
The Get-Command is the PowerShell command used to retrieve all the PowerShell command that is installed on the computer, including the cmdlets, aliases, filters, scripts, and applications.
Get-Command -noun s*
The “Get-Command -noun s*” is used to retrieve all the commands which are installed in the local system which noun is starting with s. In the “Get-Command”, the Get is the verb and command is the noun.
So here we can see the output the above command is displaying all the command whose noun is starting with the S letter.

Get-Command -noun service
This command is displaying all the command name which noun is Service. In the below, we can able to see all the command end with “-service”.

PowerShell Get-Service Command
This Get-Service Command will show all the object that represents the service on the system, it includes the running service and stopped service.

Get-Service Vss
We can able to see the “Vss service” details. We can filter the service from the Service name.

Get-service Vss | select *
Get-Service Vss only gives the 3 objects about the Vss service that is Status, Name, and DisplayName. But when we want to see all the detailed information about the vss service we will go for “get-service vss |select *“.

Get-Service|where{$_.status-eq’stopped’}
The PowerShell
“Get-Service|where{$_.status-eq ‘stopped’}” will display all the service names whose status is in a stopped state.

Start-service vss
This “Start-service vss” command will start the vss service. For checking the vss service is running or not we can see from the get-service vss. In the output we can able to see the vss is running on the local system.

Get-Service vss|Stop-Service
Here I have used the pipeline. Get-Service “vss” will give the vss service details then we can use the output in the Stop-Service. Means first we filter the vss service from all the services and then I have stopped the vss service.
To check the vss service is successfully stopped or not we can check from the Get-Service vss.

restart-service vss
Using the “restart-service vss” we can again restart the vss servie. We can again check the status we can type the Get-Service vss.

get-alias
This command display all the alias name(alternative name) for all the PowerShell command. For example, the clear-host is used to clear the host but instead of the long name we can just use cls.

get-process
The get-process command is retrieving all the running processes in the local system.

get-process -name NAMECONTROLSERVER
This command is used to display all the details of “NAMECONTROLSERVER” process. This command is used to isolate the process from the all running process.

get-process -name NAMECONTROLSERVER|get-member
This command is used to display all the properties and messages of “NAMECONTROLSERVER” running process.

PowerShell variable
We can declare a variable by using “$”. I have declared a variable with variable name processName and assign the value “Get-Process -name NAMECONTROLSERVER”.
Instead of full command, we can use the variable. $processName.Name displays the name. We can kill the process using the “$processName.Kill()”.

How to use PowerShell in SharePoint?
We can use PowerShell in SharePoint On-premises as well as SharePoint Online. You can read a detailed article on Working with PowerShell in SharePoint Online/2016/2013. And Working with PowerShell in SharePoint 2013.
You may like following PowerShell tutorials:
- Top 51 PowerShell Examples You Should Learn
- How to create and use PowerShell global variable
- PowerShell find files modified in last N days
- PowerShell find files modified in last 24 hours and PowerShell get last modified time of files in a folder
- Create a folder if not exists using PowerShell
- Create a file if not exists with a name as today’s date using PowerShell
- How to check if a file created last 24 hours using PowerShell?
- PowerShell create an encrypted password file and use in SharePoint online
- How to check file size using PowerShell [Easy Way]
- PowerShell reference variable
- Get SharePoint document library size using PowerShell
Conclusion
In the PowerShell tutorial, we discussed on PowerShell basics, a beginner’s guide to PowerShell. Learn various PowerShell basic commands, how to install PowerShell in windows 7 or windows 10. How to customize PowerShell windows properties like font, color, layouts, etc.
Hello Everyone!! I am Bhawana a SharePoint MVP and having about 10+ years of SharePoint experience as well as in .Net technologies. I have worked in all the versions of SharePoint from wss to Office 365. I have good exposure in Customization and Migration using Nintex, Metalogix tools. Now exploring more in SharePoint 2016 🙂 Hope here I can contribute and share my knowledge to the fullest. As I believe “There is no wealth like knowledge and no poverty like ignorance”