2009年6月11日 星期四

SharePoint: Deploy/Remove new wsp feature

Create
@SET STSADM=”c:\program files\common files\microsoft shared\web server extensions\12\bin\stsadm.exe”
%STSADM% -o addsolution -filename OfficeSpaceFeature.wsp
%STSADM% -o deploysolution -name OfficeSpaceFeature.wsp -immediate -allowGacDeployment
%STSADM% -o execadmsvcjobs

if you get error
This solution contains resources scoped for a Web application and must be deployed to one or more Web applications.

stsadm -o deploysolution -name OfficeSpaceFeature.wsp -immediate -allowgacdeployment -allowcaspolicies -url http://tt.it.com

stsadm -o upgradesolution -name PsiCntLib.wsp -filename PsiCntLib.wsp -immediate -allowGacDeployment

Remove
@SET STSADM=”c:\program files\common files\microsoft shared\ web server extensions\12\bin\stsadm.exe”
%STSADM% -o retractsolution -name OfficeSpaceFeature.wsp -immediate
%STSADM% -o execadmsvcjobs
%STSADM% -o deletesolution -name OfficeSpaceFeature.wsp

By the way deploye EVENT EVENT:
stsadm.exe -o installfeature -name EventHandlerFolderName
stsadm.exe -o activatefeature -name EventHandlerFolderName -url http://xxx/webname/ -force
stsadm -o execadmsvcjobs


stsadm -o deactivatefeature -name EventHandlerFolderName-url http://xxx/webname/
-force
stsadm -o uninstallfeature -name EventHandlerFolderName-force
stsadm -o execadmsvcjobs
--stsadm -o deletesolution -name EventHandlerFolderName-override

at 7/10/2008 07:52:00 AM


SharePoint PowerShell 2010


Add-SPSolution “D:\Deploy\MySharePointSolution.wsp
Install-SPSolution –Identity MySharePointSolution.wsp –WebApplication http://myspwebapp –GACDeployment
If you would like to add the solution as sandboxed, you would use the Install-SPUserSolution command instead. To upgrade a solution, we specify which solution is to be updated and with which new solution file:
Update-SPSolution –Identity MySharePointSolution.wsp –LiteralPath “D:\Deploy\MySharePointSolution.wsp” –GacDeployment
To retract and remove a solution, we use the following commands:
Uninstall-SPSolution –Identity MySharePointSolution.wsp –WebApplication http://myspwebapp
Remove-SPSolution–Identity MySharePointSolution.wsp

Working with features

Similarly, commands exist for working with features. The stsadm equivalents:
stsadm –o activatefeature –name MyFeatureName –url http://myspwebapp
stsadm –o deactivatefeature –name MyFeatureName –url http://myspwebapp
Needless to say, there are easy equivalents in PowerShell:
Enable-SPFeature –Identity MyFeatureNameOrGuid –url http://myspwebapp
Disable-SPFeature –Identity MyFeatureNameOrGuid –url http://myspwebapp


沒有留言:

張貼留言