All of sudden my PowerShell stopped working with following error:-
“The local farm is not accessible. Cmdlets with FeatureDependencyId are not registered”
I am currently with SharePoint 2010 on my development machine on Windows 7with SP1. After SharePoint installation for couple days PowerShell was working absolutely fine but now when I need to do something with scripting it has stopped working.
Tried two things very quick but still no luck:-
- I have already tried to run PowerShell run as Administrator
- I have already given
To resolve the issue quick: I changed PowerShell start menu short cut path and added –version 2.0 switch parameter, below is the complete path with –version 2.0 switch.
C:\Windows\SYSTEM32\WINDOWSPOWERSHELL\V1.0\PowerShell.exe -version 2.0 -NoExit " & ' C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\CONFIG\POWERSHELL\Registration\\sharepoint.ps1' "
Add –version 2.0 swtich
By doing this I could run PowerShell 2.0 which support SharePoint 2010 commands