首先打开“SharePoint Management Shell”,如下图:
在上面的命令窗口执行以下命令,实现所需:
添加: 添加至SharePoint 解决方案
stsadm -o addsolution -filename [wsp文件路径]
示例:stsadm -o addsolution -filename C:\SharePoint.Notice.wsp
部署:部署该解决方案至指定站点
stsadm -o deploysolution -name [wsp名称] -immediate -url [要发布的站点] -allowGacDeployment
示例:stsadm -o deploysolution -name SharePoint.Notice.wsp -immediate -url http://hkc -allowGacDeployment
回收:从指定站点回收该解决方案,但解决方案仍在SharePoint解决方案中
stsadm -o retractsolution -name [wsp名称] -immediate -url [要回收的站点]
示例:stsadm -o retractsolution -name SharePoint.Notice.wsp -immediate -url http://hkc
删除:从SharePoint 中删除该解决方案
stsadm -o deletesolution -name [wsp名称]
示例:stsadm -o deletesolution -name SharePoint.Notice.wsp
更新:直接更新某站点下的解决方案(前提是被更新的解决方案已存在,无需回收和删除操作)
stsadm.exe -o upgradesolution -name [wsp名称] -filename [wsp文件路径] -immediate -allowGacDeployment
示例:stsadm.exe -o upgradesolution -name SharePoint.BBS.wsp -filename C:\SharePoint.BBS.wsp -immediate -allowGacDeployment