Snapin ne se charge pas, les cmdlets ciblent désormais la mauvaise version PowerShell, comment cela se produisait?

sharepoint.stackexchange https://sharepoint.stackexchange.com//questions/97953

  •  10-12-2019
  •  | 
  •  

Question

J'ai hérité d'un environnement ServerPoint-2008 SharePoint-2010 Dev Environment, le snapin SharePoint ne parvient pas à charger;AVERTISSEMENT ...

Add-PSSnapin : Incorrect Windows PowerShell version 3.0. Windows PowerShell 
version 2.0 is supported in the current console.

J'ai suivi tous les remèdes documentés:

  • Désinstallez WMF 3.0 et KB2506146
  • Exécuter PowerShell.exe avec le paramètre "-Version 2.0"
  • Supprimez la référence à .NET 4.0 à partir de la configuration PowerShell

    Le snapin ne parvient pas à charger et toujours le même avertissement "version incorrecte de Windows PowerShell ..." donc je confirme la version.Il a l'air bien ...

    PS C:\Users\Administrator> $PSVersionTable.PSVersion
    
    Major  Minor  Build  Revision
    -----  -----  -----  --------
    2      0      -1     -1
    

    Alors j'ai vérifié le Snapin ...

    PS C:\Users\Administrator> Get-PSSnapIn -Registered
    
    Name        : Microsoft.SharePoint.PowerShell
    PSVersion   : 3.0
    Description : Register all administration Cmdlets for Microsoft SharePoint Server
    

    Le psversion est 3.0 ??? Le psversion pour la connexion Snapin lit 1.0 sur toutes les autres machines.Et ne fonctionne pas dans 3.0 en raison du document 4.0 .NET.Comment puis-je changer ce dos?Afin qu'il cible la version compatible de Powershell? Merci pour toute aide que vous pouvez offrir.

Était-ce utile?

La solution

The registry determines the level of PS compatibility, in my case the value was 3.0, it should be 1.0. I corrected this value by editing the following key:

HKLM\SOFTWARE\Microsoft\PowerShell\1\PowerShellSnapIns\Microsoft.SharePoint.PowerShell\PowerShellVersion

The initial cause of the problem was the installation of the Windows Management Framework 3.0 which installs with it PowerShell. Even after uninstalling, the registry remained incorrect and I had to edit the registry with the information above.

Licencié sous: CC-BY-SA avec attribution
Non affilié à sharepoint.stackexchange
scroll top