PowerShell Cmdlets with FeatureDependencyId are not registered in SharePoint 2010
PowerShell Cmdlets with FeatureDependencyId are not registered in SharePoint 2010
I’ve been doing a lot of development on one of my SharePoint 2010 Windows 7 machines lately and I deleted a bunch of site collections and generally cleaned things up to get ready for a new round of projects.
I popped open the SharePoint 2010 Management Shell to get a feel for what was left and got the following error:
The local farm is not accessible. Cmdlets with FeatureDependencyId are not registered.
What the heck?
I tried to run a quick Get-SPSite and got this:
Double what the heck? I thought for sure that I did something with one of my development projects…I had done a bunch of stuff with the using Microsoft.SharePoint.Administration; at the top of my C# files so I was a little concerned. On closer inspection it wasn’t me (I don’t think). Look at this error: Microsoft SharePoint is not supported with version 4.0.30319.296 of the Microsoft .Net Runtime
From the errors it seems like an update I did suddenly had my SharePoint 2010 Management Shell using the wrong version of PowerShell or something.
In any case after a little searching I found a work around posted on a Microsoft PFE site: SharePoint 2010 Management Shell – .Net 4.0 runtime version error
The workaround posted didn’t work for me (so close but the order of the parameter was just a bit off) but one of the comments had the fix. I added a parameter to the startup target properties of the Shortcut.
I changed it from:
C:\Windows\System32\WindowsPowerShell\v1.0\PowerShell.exe -NoExit " & ' C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\CONFIG\POWERSHELL\Registration\\sharepoint.ps1 ' "
To:
C:\Windows\System32\WindowsPowerShell\v1.0\PowerShell.exe -Version 2 -NoExit " & ' C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\CONFIG\POWERSHELL\Registration\\sharepoint.ps1 ' "
Notice the –Version 2 parameter addition (it matters where it goes by the way) and voilà it all works again:
Whew, that feels great. And look I’m down to under 20 site collections, this won’t last long even on my dev box! (which by the way is a Mac Book Pro Boot Camped with Windows 7 and a full SharePoint 2010 Installation along with email!) I use Smarter Tools for the local email server and it works amazingly well)
Enjoy,
Spike Xavier
SharePoint Instructor – Interface Technical Training
Phoenix, AZ
You May Also Like
A Simple Introduction to Cisco CML2
0 3859 0Mark Jacob, Cisco Instructor, presents an introduction to Cisco Modeling Labs 2.0 or CML2.0, an upgrade to Cisco’s VIRL Personal Edition. Mark demonstrates Terminal Emulator access to console, as well as console access from within the CML2.0 product. Hello, I’m Mark Jacob, a Cisco Instructor and Network Instructor at Interface Technical Training. I’ve been using … Continue reading A Simple Introduction to Cisco CML2
Cable Testers and How to Use them in Network Environments
0 713 1This content is from our CompTIA Network + Video Certification Training Course. Start training today! In this video, CompTIA Network + instructor Rick Trader demonstrates how to use cable testers in network environments. Let’s look at some tools that we can use to test our different cables in our environment. Cable Testers Properly Wired Connectivity … Continue reading Cable Testers and How to Use them in Network Environments
Government Edition – Encrypting a USB Flash Drive in Windows 10
0 272 2In this video, Security Instructor Mike Danseglio demonstrates how to use BitLocker in Window 10 to secure files on a USB Flash drive that adhere to stricter data protection requirements as found inside Government entities. BitLocker 2-day instructor-led training is now available at Interface: BITLOCK: Planning and Deploying BitLocker Drive Encryption Training Video Transcription: Hi. … Continue reading Government Edition – Encrypting a USB Flash Drive in Windows 10
See what people are saying...