Quantcast
Channel: SharePoint 2013 - Setup, Upgrade, Administration and Operations forum
Viewing all articles
Browse latest Browse all 21070

Best way to add, deploy and remove the solutions in Sharepoint 2013 Environment?

$
0
0

Hi All,

We have a plugin, on installation of this plugin, we have an "exe" which will add and deploy the solution(.wsp files) in central configuration site. On Un - installation of the plugin, the exe will deactivate the activated features related to our plugin, retract the solution and finally remove the solution. This plugin will be installed in all web front ends.

For performing the above operation, we can use PowerShell commands or SharePoint APIS (as STSADM is deprecated, I am not including that). May I know the best way to do the same?

PowerShell commands:

There are two ways in this also

  1. Passing the PowerShell commands to System.Diagnostics.Process

        ProcessStartInfo pInfo = new ProcessStartInfo("<PowerShellExePath>", "<ScriptToExecute or Powershell File Name");

        Process process = new Process();
        process.StartInfo = pInfo;
        process.Start()

  2.  Runspace API

            Runspace runspace = RunspaceFactory.CreateRunspace(InitialSessionState.CreateDefault());
            runspace.Open();

            PowerShell powerShellCommand = PowerShell.Create();
            powerShellCommand.Runspace = runspace;
            powerShellCommand.AddScript("Add-PsSnapin Microsoft.SharePoint.PowerShell");
            powerShellCommand.AddScript(script);

            powerShellCommand.Invoke<string>();

SharePoint APIs

Microsoft.SharePoint.Administration.SPFarm.Local.Solutions.Add or Microsoft.SharePoint.Administration.SPFarm.Local.Solutions.Remove].

Thanks & Regards,

Kalai.




Viewing all articles
Browse latest Browse all 21070

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>