Resolving error "No snap-ins have been registered for windows powershell version 2"
After doing some update\configuration changes in SharePoint Farm, I was getting this issue when trying to open "SharePoint 2010 Management Shell":
Add-PSSnapin : No snap-ins have been registered for windows powershell version 2
This was resolved by changing the path of the powershell.exe used to initiate the management shell. In properties -> Shortcut -> Target, powershell.exe was pointing to sysWOW64 folder. I changed the same to point to System32 [c:\windows\system32\windowspowershell\v1.0\powershell.exe].
Comments
Anonymous
December 18, 2011
my powershell points to "%SystemRoot%system32WindowsPowerShellv1.0powershell.exe" and i change to "c:windowssystem32windowspowershellv1.0powershell.exe". And still have same problemAnonymous
December 19, 2011
complete syntax should look similar to this with respect to your farm installation: C:WindowsSystem32WindowsPowerShellv1.0powershell.exe -NoExit " & ' C:Program FilesCommon FilesMicrosoft SharedWeb Server Extensions14CONFIGPOWERSHELLRegistrationsharepoint.ps1 ' "
- you can try adding "Microsoft.SharePoint.PowerShell" on a normal powershell window to validate if the snap-in can be added
- Verify that 'sharepoint.ps1' file exists in the folder location indicated in your farm
Anonymous
November 30, 2012
User "windows PowerShell ISE" ..U will not et the above error.Anonymous
August 12, 2013
For Paresh's trick to work, you have to create another shortcut directly to the powershell.exe he mentioned (C:WindowsSystem32WindowsPowerShellv1.0powershell.exe). If you go back to the one in the SysWOW folder, it will not work and will still think SP is not registered.Anonymous
January 22, 2016
The Windows Server 2008 R2 PowerShell fix for me was to copy the PowerShell registry key from a working server to the one that was having problems. HKEY_LOCAL_MACHINESOFTWAREMicrosoftPowerShell Problem solved. The SharePoint PowerShell snapin is now Registered and the one that gets installed with SharePoint works.