SharePoint 2013 Developer Tricks to use Powershell Command

* Following command is use to deploy DLL into GAC:
FOR %1 IN (*) DO Gacutil /i %1
Gacutil /i Telerik.Web.UI.dll

* Dll location

Install Feature - Installs a SharePoint Feature by using the Feature.xml file.

stsadm -o installfeature -name "featureName1"

* Add Wsp - Uploads a SharePoint solution package to the farm/store.
stsadm -o addsolution -filename "C:\Responsive.wsp"

Add-SPSolution "C:\Responsive.wsp"

* Wsp Deployment command - Deploys an installed SharePoint solution in the farm/store.
stsadm -o deploysolution -name "Responsive.wsp" -url -allowgacdeployment -immediate –force

Install-SPSolution –Identity "Responsive.wsp" –WebApplication -GACDeployment -Force

* Upgrade Solution - Upgrades a deployed SharePoint solution.
stsadm –o upgradesolution –name "Responsive.wsp" –filename "C:\Responsive.wsp" –immediate –Force

Update-SPSolution –Identity "Responsive.wsp" –LiteralPath "C:\Responsive.wsp" –GACDeployment

* Solution Retract & Remove - Removes a SharePoint solution from a farm.

stsadm -o deletesolution -name "Responsive.wsp" -override

Uninstall-SPSolution -Identity "Responsive.wsp" [ –WebApplication ] optional if not deployed globally.

Remove-SPSolution -Identity "Responsive.wsp"

* TimerJob wsp Deployment command - TimerJob work at global level in farm

stsadm -o deploysolution -name "timerjobssolution.wsp" -allowgacdeployment -immediate -force ( URL not needed as timer is global )

* Export Web Application

stsadm -o export -url -filename "C:\Packages\NewTest.cmp" –nofilecompression

Export-SPWeb –Path "C:\Packages\ NewTest.cmp" -nofilecompression

* Import Web application ( if web application already exist drop site collection)

stsadm -o import -url -filename "C:\Packages\ NewTest.cmp" –nofilecompression

Import-SPWeb -Path "C:\Packages\ NewTest.cmp" -UpdateVersions Overwrite

* Microsoft SharePoint Foundation Web Application Start

stsadm -o provisionservice -action start -servicetype spwebservice

* Solution Deployment Error:

.Retract solution via central admin / visual studio.
.Remove from central admin.
.Publish application ( generate .wsp )
.copy wsp and paste it. change extension from .wsp to .zip
.extract zip folder.
.copy feature folder @ C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\15\TEMPLATE\FEATURES
. install feature with force
stsadm -o installfeature -name "featureName1" -force
. uninstall feature with force
stsadm -o uninstallfeature -name "featureName1" -force
.add solution
stsadm -o addsolution -filename "C:\Responsive.wsp"
.deploy solution via central admin.
i deploysolution -name "Responsive.wsp" -url -allowgacdeployment -immediate -force

* Package Import Steps:

.Delete Site collection
.Create New Site Collection.
.Check Web.config Entries and dll placed in GAC.
.Change Site Collection administrator as per needed like add contoso\administrator & administrator as users.
.Deply All WSP into site.
.Import Package now.