• 博客园logo
  • 会员
  • 周边
  • 新闻
  • 博问
  • 闪存
  • 众包
  • 赞助商
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
ChunLiang
博客园    首页    新随笔    联系   管理    订阅  订阅
用PowerShell部署WSP
现在可以用SharePoint PowerShell去部署自己的WSP。
SharePoint Management Shell (powershell with the Microsoft.SharePoint.Powershell snapin loaded) 
 
1.Add Solution Package
Add-SPSolution “C:\SharePoint2010Solution.wsp”
2.Install Solution Package
Install-SPSolution –Identity SharePoint2010Solution.wsp –WebApplication http://myserver –GACDeployment
3.Install Solution Package
Install-SPUserSolution –Identity SharePoint2010Solution.wsp     –WebApplication http://myserver  –GACDeployment
4.Update Solution Package
Update-SPSolution –Identity SharePoint2010Solution.wsp –LiteralPath “C:\SharePoint2010Solution.wsp” –GacDeployment
5.Uninstall Solution Package
Uninstall-SPSolution –Identity MySharePointSolution.wsp –WebApplication    http://myserver
6.Remove Solution Package
Remove-SPSolution–Identity MySharePointSolution.wsp
 
当然有时候PowerShell没有stsadm命令好用。当PowerShell部署有问题的时候,也可以试试stsadm命令。
1. stsadm –o addsolution –filename “D:\Deploy\MySharePointSolution.wsp“
2. stsadm –o deploysolution –name MySharePointSolution.wsp –url http://myspwebappp –allowgacdeployment –immediate
3. stsadm –o upgradesolution –name MySharePointSolution.wsp –filename “D:\Deploy\MySharePointSolution.wsp” -immediate
4. stsadm –o retractsolution –name MySharePointSolution.wsp –url http://myspwebapp –immediate
5. stsadm –o deletesolution –name MySharePointSolution.wsp
 
有一次部署WSP的时候,用PowerShell命令部署后说部署的不成功,但是这个WSP的feature又卸载不掉,下次部署又重复了。又要先解决feature问题。
stsadm –o activatefeature –name MyFeatureName –url http://myspwebapp
stsadm –o deactivatefeature –name MyFeatureName –url http://myspwebapp
或者
Enable-SPFeature –Identity MyFeatureNameOrGuid –url http://myspwebapp
Disable-SPFeature –Identity MyFeatureNameOrGuid –url http://myspwebapp
 
 
posted on 2012-07-18 14:26  ChunLiang  阅读(668)  评论(0)    收藏  举报
刷新页面返回顶部
博客园  ©  2004-2025
浙公网安备 33010602011771号 浙ICP备2021040463号-3