深入浅出PowerShell——部署SharePoint解决方案包
下文以开发HR的Leave系统并部署为例:
安装部署
Add-SPSolution -LiteralPath E:\Alfred\Project\SIRS\Workflow\TFS\AZ.SharePoint.SIRS\AZ.SharePoint.SIRS\bin\Debug\sharepoint.leave.wsp
Install-SPSolution -Identity sharepoint.leave.wsp -GACDeployment
说明:全新部署的方式。如果此解决方案中有多个项目或引用了第三方的dll,即有多个dll程序集文件,需要使用参数-GACDeployment,这样相关引用的dll文件会被添加到GAC中。
升级部署update-spsolution -identity sharepoint.leave.wsp -literalpath D:\TFS\SharePoint.HR\SharePoint.LEAVE\bin\Debug\sharepoint.leave.wsp -GACDeployment
说明:如果解决方案中包含TaskForm(使用InfoPath),如果TaskForm有更新,必须手工重新激活TaskForm相应的Feature。反之则仅执行此命令即可。
升级部署包含TaskForm的feature的例子
update-spsolution -identity lj.hr.wsp -literalpath D:\TFS
\LJ.SharePoint.HR\LJ.SharePoint.HR\bin\Debug\lj.hr.wsp -gacdeployment
Uninstall-SPFeature -Identity "a7c5fb24-9df2-4e58-8bc6-5fd79b08c757"
Disable-SPFeature -Identity "a7c5fb24-9df2-4e58-8bc6-5fd79b08c757" -URL "https://dev61.emdev.azcollaboration.com/operations/Operations"
install-SPFeature -path "LJ.SharePoint.HR_HR.levaeWorkFlow"
Enable-SPFeature -Identity "a7c5fb24-9df2-4e58-8bc6-5fd79b08c757" -URL "https://dev61.emdev.azcollaboration.com/operations/Operations"
说明:LJ.SharePoint.HR_HR.levaeWorkFlow为Feature名称。