none
Microsoft.SharePoint.PowerShell in GAC but stil getting not installed error RRS feed

  • Question

  • HI everyone,

    I'm new to powershell and I'm working on trying to run some powershell on an on prem 2013 environment and I am getting the following error:

    Add-PSSnapin : The Windows PowerShell snap-in 'Microsoft.SharePoint.PowerShell' is not installed on this computer.
    At line:3 char:5
    +     Add-PSSnapin "Microsoft.SharePoint.PowerShell"
    +     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : InvalidArgument: (Microsoft.SharePoint.PowerShell:String) [Add-PSSnapin], PSArgumentException
        + FullyQualifiedErrorId : AddPSSnapInRead,Microsoft.PowerShell.Commands.AddPSSnapinCommand

    But the dll is installed in the GAC here: C:\Windows\Microsoft.NET\assembly\GAC_MSIL\Microsoft.SharePoint.PowerShell\v4.0_15.0.0.0__71e9bce111e9429c\Microsoft.SharePoint.Powershell.dll

    Any help is appreciated,
    Hyde


    There is nothing more difficult to take in hand, more perilous to conduct or more uncertain in its success than to take the lead in the introduction of a new order of things.

    Thursday, February 2, 2017 2:21 AM

All replies

  • Can you check if you have admin access on the said server and you are trying to run PowerShell prompt as administrator?

    Thanks
    Mohit

    Thursday, February 2, 2017 4:45 AM
  • Hi, 

    seems like something messed up the installation, Try to run below command and check if it works-

    C:\Windows\Microsoft.NET\Framework64\v4.0.30319\InstallUtil /LogToConsole=true C:\Windows\Microsoft.NET\assembly\GAC_MSIL\Microsoft.SharePoint.Power Shell\v4.0_15.0.0.0__71e9bce111e9429c\Microsoft.SharePoint.Powershell.dll

    Source : https://social.technet.microsoft.com/wiki/contents/articles/31402.sharepoint-troubleshooting-microsoft-sharepoint-powershell-snap-in-is-not-installed-on-this-computer.aspx

     

    Regards,

    Gaurav

    Thursday, February 2, 2017 5:10 AM
  • Thanks for the reply, yes I have admin access and I am running powershell as an admin.

    There is nothing more difficult to take in hand, more perilous to conduct or more uncertain in its success than to take the lead in the introduction of a new order of things.


    • Edited by Hyde_311 Friday, February 3, 2017 2:12 AM added words
    Friday, February 3, 2017 2:10 AM
  • Thanks for the reply, I tried that earlier and it didn't seem to make a difference.

    There is nothing more difficult to take in hand, more perilous to conduct or more uncertain in its success than to take the lead in the introduction of a new order of things.

    Friday, February 3, 2017 2:11 AM
  • Try to load dll directly:

    [System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint")

    Then check if dll is loaded using below:

    [AppDomain]::CurrentDomain.GetAssemblies() | ForEach-Object 
      { Split-Path $_.Location -Leaf } | Sort

    Also check if you can open SharePoint 2013 management shell in admin and it loads snap-in for you.

    Let us know how it goes.



    Thanks
    Mohit


    Friday, February 3, 2017 5:59 AM