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….
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*
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 the following SharePoint PowerShell tutorials:
- How to get all SharePoint users and groups using PowerShell
- How to get SharePoint features using PowerShell
- How to upload files to SharePoint using PowerShell
- How to Change SharePoint Site Logo + PowerShell
- Get sharepoint site template PowerShell
- Display warning message in SharePoint site using PowerShell
- How to remove SharePoint Online Modern Page Title using PowerShell
- How to get file modification time and date using PowerShell
I am Krishna.Vandanapu a SharePoint architect working in IT from last 13+ years, I worked in SharePoint 2007, 2010, 2013, 2016 and Office 365. I have extensive hands on experience in customizing SharePoint sites from end to end. Expertise in SharePoint migration tools like Sharegate, Doc Ave and Metalogix. Migrated SharePoint sites from SharePoint 2007 to 2010 and 2010 to 2013 several times seamlessly. Implementing CSOM with Microsoft best practices. Spent quality time in configuring SharePoint application services like User Profile, Search, Managed Meta data services etc. Now exploring SharePoint Framework and SharePoint 2019