zoukankan      html  css  js  c++  java
  • PowerShell命令部署WSP

    转载:http://www.cnblogs.com/ChunLiangZhang/archive/2012/07/18/2597335.html(作者:ChunLiang

    现在可以用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:DeployMySharePointSolution.wsp“
    2. stsadm –o deploysolution –name MySharePointSolution.wsp –url http://myspwebappp –allowgacdeployment –immediate
    3. stsadm –o upgradesolution –name MySharePointSolution.wsp –filename “D:DeployMySharePointSolution.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
  • 相关阅读:
    Python str转化成数字
    MySQL之CONCAT()的用法
    MySQL之LIMIT用法
    MySQL中LOCATE用法
    设计模式-模版方法
    设计模式-单例模式
    设计模式-桥接模式
    UML图标含义及记忆方法
    redis-分布式锁-消除竞争条件
    redis-分布式锁-刷新信号量
  • 原文地址:https://www.cnblogs.com/lishidefengchen/p/5253023.html
Copyright © 2011-2022 走看看