Saturday, September 20, 2014

The term 'get-spfarm' is not recognized

I was using Windows Poweshell - ISE for creating some power shell scripts and got the following error.

"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 included, verify that the path is correct and try again."

Checked the PowerShell Code and found that I forgot to add powershell snapin and added the following and the script got executed.

Add-PSSnapin "Microsoft.SharePoint.PowerShell" 

2 comments:

  1. Thank you! This worked for me.

    ReplyDelete
  2. thanks, that worked for me too. I was looking for the snapin name and it was pretty obvious

    ReplyDelete