sql server 2008 – No snap-ins have been registered for Windows PowerShell version 2

sql server 2008 – No snap-ins have been registered for Windows PowerShell version 2

If you do:

Get-PSSnapin -Registered

youll get a list of ready-to-use snap-ins for PowerShell (here just those for SQL) :

Name        : SqlServerCmdletSnapin100
PSVersion   : 2.0
Description : This is a PowerShell snap-in that includes various SQL Server cmdlets.

Name        : SqlServerProviderSnapin100
PSVersion   : 2.0
Description : SQL Server Provider

if you cant see these snap-ins in the list, try the solution posted here.

In a slightly similar vein to the above answer, I found that by default I was using the Visual Studio Command Prompt which runs in 32-bit.

Therefore, when using InstallUtil against my powershell library, the registration occurred to the 32-bit version of Powershell so I was confused that I couldnt find my cmdlets in the -Registered collection.

If I subsequently launched powershell (x86) then my snapins were indeed registered as expected. So, the solution for me was to re-register my snapins from an x64 command prompt or simply use the x86 version of powershell.

sql server 2008 – No snap-ins have been registered for Windows PowerShell version 2

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.

Leave a Reply

Your email address will not be published.