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
  • 相关阅读:
    JVM学习(2):类加载器
    JVM学习(1):类加载机制
    MySQL优化(7):其他注意事项
    MySQL优化(6):分表和读写分离
    MySQL优化(5):分区
    MySQL优化(4):查询缓存
    MySQL优化(3):索引
    关于博客
    【题解】Telephone Lines
    【题解】神经网络
  • 原文地址:https://www.cnblogs.com/lishidefengchen/p/5253023.html
Copyright © 2011-2022 走看看