Fix "Get-SPWeb : The term 'Get-SPWeb' 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." Error in PowerShell

Problem: When trying to run a PowerShell script in SharePoint, got this error
Get-SPWeb : The term 'Get-SPWeb' 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.
Get-SPWeb : The term 'Get-SPWeb' 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.


Troubleshooting Checklist:
  • You may face this error if you try to run a PowerShell script through Windows PowerShell or PowerShell ISE and this error could be because of the PowerShell module for SharePoint is not loaded. Make sure you add "Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue" in Line#1. Alternatively, you can use "SharePoint 2016 Management Shell" that loads the necessary modules by default.
  • You must run the PowerShell script for SharePoint On-premises in any of the SharePoint Server in the server farm (and not from your client machine!)

No comments:

Please Login and comment to get your questions answered!

Powered by Blogger.