Snapin no se carga, los cmdlets ahora se dirigen a la versión incorrecta de PowerShell, ¿cómo sucede eso?

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

  •  10-12-2019
  •  | 
  •  

Pregunta

He heredado un entorno de desarrollo de servidor-2008 SharePoint-2010, la Snapin de SharePoint no se carga;Advertencia ...

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

Siguió todos los remedios documentados:

  • desinstala wmf 3.0 y kb2506146
  • Ejecutar PowerShell.exe con el parámetro "-version 2.0"
  • Eliminar la referencia a .NET 4.0 de la configuración de PowerShell

    El Snapin no se carga y sigue siendo la misma advertencia "Versión incorrecta de Windows PowerShell ...", así que confirmo la versión.Se ve bien ...

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

    Así que revisé el Snapin ...

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

    la psversion es 3.0 ??? La Psversión para la Snapin lee 1.0 en todas las demás máquinas.Y no se ejecuta en 3.0 debido al marco 4.0 .NET.¿Cómo puedo cambiar esto de vuelta?¿Para que se dirige a la versión compatible de PowerShell? Gracias por cualquier ayuda que pueda ofrecer.

¿Fue útil?

Solución

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.

Licenciado bajo: CC-BY-SA con atribución
scroll top