[Solved] Get-SPFarm : The term Get-SPFarm is not recognized as the name of a cmdlet, function, script file or operable program error in PowerShell ISE in SharePoint 2013

In this SharePoint PowerShell tutorial, we will discuss how to solve Get-SPFARM is not recognized as the name of a cmdlet in PowerShell ISE in SharePoint 2013.

When I try to execute “Get-SPFarm” in PowerShell ISE on WFE I got the below error message:

Get-SPFarm : The term Get-SPFarm is not recognized as the name of a cmdlet, function, script file or operable program. Check the spelling of the name or if a path was….

Get-SPFARM is not recognized as the name of a cmdlet in PowerShell ISE
Get-SPFARM is not recognized as the name of a cmdlet in PowerShell ISE

The mistake I have done here is PowerShell ISE is designed for Windows PowerShell scripts. The script I was trying to execute is to get the FARM object and all the services running in that FARM. So we have to include SharePoint snapin to PowerShell.

Follow the below steps to execute this script in PowerShell ISE without this error:

1. Navigate to 15 hives bin folder with the below command

cd ‘.\Program Files\Common Files\microsoft shared\Web Server Extensions\15\BIN’

2. Once you move on to the bin folder add the snapin by executing the below command

ADD-PSSnapin *sharepoint*

Get-SPFARM is not recognized as the name of a cmdlet in PowerShell ISE Tutorial
Get-SPFARM is not recognized as the name of a cmdlet in PowerShell ISE Tutorial

3. By executing the above command PowerShell ISE will include all the SharePoint related dll files to execute any SharePoint object.

4. Now if you execute the script by clicking on F5 or by clicking on the play button you will see the output seamlessly.

Hope this helps to solve Get-SPFarm : The term Get-SPFarm is not recognized as the name of a cmdlet, function, script file or operable program error., Happy development in SharePoint  !!!!

You may like following SharePoint PowerShell tutorials:

Donwload Hub site pdf

Download SharePoint Online Tutorial PDF FREE!

Get update on Webinars, video tutorials, training courses etc.

>