Wednesday, December 26, 2012

deploy user controls and web parts in powershell

Deploy user control (it is deployed globally and not associated with any application)
In sharepoint project, make sure the first line in the user control aspx, <%@ Assembly Name="$SharePoint.Project.AssemblyFullName$" %>,  has been replace with the real assembly name (<%@ Assembly Name="MapArea, Version=1.0.0.0, Culture=neutral, PublicKeyToken=bf461b57440b5559" %>) in stead of a reference to the proj file.

uninstall-spsolution -identity MapArea.wsp    (remove folder in \14\template\controltemplates)
remove-spsolution -identity MapArea.wsp     (remove dll from gac)

gacutil /i MapArea.dll
copy \Maparea\map.aspx to C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\CONTROLTEMPLATES\MapArea (folder varies depending on what folder you want to deploy to)

add-spsolution -literalpath C:\Installs\webparts\Liheap\MapArea\bin\Debug\MapArea.wsp
Install-SPSolution -Identity MapArea.wsp -GACDeployment

Deploy a web part (this needs to be deployed to a particular web application)




http://yourwebapplication
stsadm -o addsolution -filename C:\Installs\IndividualZips\SectorPoint.Products.AdRotator.wsp
stsadm -o deploysolution -name SectorPoint.Products.AdRotator.wsp -allowCas -local -url http://yourwebapplication

use this command to get the solutions:

GET-SPSOLUTION


to retract a solution:

uninstall-spsolution -identity SectorPoint.Products.AdRotator.wsp -webapplication http://devwebsites.com.wa.lcl


to remove a solution from farm:

remove-spsolution -identity SectorPoint.Products.AdRotator.wsp


to add solution to the sharepoint solution store:
add-spsolution -literalpath C:\Installs\IndividualZips\SectorPoint.Products.AdRotator.wsp

To Deploy the solution.

Install-SPSolution -Identity SectorPoint.Products.AdRotator.wsp -WebApplication http://devwebsites.com.wa.lcl -CASPolicies
-------------------------------------------------------------------
uninstall-spsolution -identity CommerceTreeViewNavigation.wsp -webapplication http://yourwebapplication

remove-spsolution -identity CommerceTreeViewNavigation.wsp

add-spsolution -literalpath C:\Installs\IndividualZips\CommerceTreeViewNavigation.wsp

Install-SPSolution -Identity CommerceTreeViewNavigation.wsp -WebApplication http://yourwebapplicationt
--------------------------------------------------------------------------------------------



add-spsolution -literalpath C:\Installs\IndividualZips\SectorPoint.Products.AdRotator.wsp
http://yourwebapplicationt

Install-SPSolution -Identity CommerceTreeViewNavigation.wsp -WebApplication http://yourwebapplication -GACDeployment


No comments:

Post a Comment