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" 

1 comment: