转载: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:\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

PowerShell命令部署WSP的更多相关文章

  1. 用PowerShell批量部署wsp包

    转:http://www.xuebuyuan.com/168337.html 提供wsp部署的参数: $wsppath:wsp文件所在的路径,如"c:\" $wspnames:路径 ...

  2. 使用命令部署wsp包,并将其部署到不同的web应用程序

    http://www.c-sharpcorner.com/uploadfile/anavijai/how-to-deploy-a-wsp-using-powershell-in-sharepoint- ...

  3. 使用PowerShell快速部署Win12R2虚拟化桌面

    PowerShell一直是微软windows_Server产品中重要的一部分,可以通过PowerShell来完成所有的服务器配置,甚至一些在图形界面下无法完成的事情.随着每一个新版本的微软产品或者服务 ...

  4. SharePoint 2010 PowerShell 系列 之 备份、还原、部署 .WSP

    转:http://www.cnblogs.com/Fengger/archive/2012/08/24/2654093.html PowerShell系列目录 最近在部署测试环境,就顺便把PowerS ...

  5. 在Jenkins中执行 PowerShell 命令实现高效的CD/CI部署

    相比于cmd,powershell支持插件.语法扩展和自定义扩展名,是智能化部署中闪闪的新星,越来越多的开发者偏爱使用Powershell. 如何让Jenkins支持Powershell呢?本文即展开 ...

  6. 转载 SharePoint开发部署WSP解决方案包

    转载原出处: http://642197992.blog.51cto.com/319331/1582731 注:本文所讲内容以SharePoint2013版本为例,开发工具以VS2013为基础.历史版 ...

  7. 使用PowerShell脚本部署定时器到MOSS2010

    转:http://www.77site.com/tech/1087042010072906074113_2012050808152911.html 第一章 前言 在此次练习中,您将了解到如何使用Pow ...

  8. SharePoint 2010 使用Install-SPSolution部署wsp包状态一直是”正在部署”

    1.服务器场信息如下: 2.使用下面命令部署,状态一直是"正在部署" Install-SPSolution –Identity xxxx.wsp –WebApplication h ...

  9. SharePoint 2013 PowerShell命令备份还原报错

    错误截图: 文字描述: Restore-SPSite : <nativehr>0x80070003</nativehr><nativestack></nati ...

随机推荐

  1. ubuntu系统里vi编辑器时,按方向箭头输入是乱码的ABCD字母?(图文详解)

    不多说,直接上干货! 问题详情 ubuntu系统里vi编辑器时,按方向箭头输入是乱码的ABCD字母?  解决办法 是由于预装的vim软件没更新,运行   sudo apt-get install vi ...

  2. jQuery-图片的放大镜显示效果(不需要大小图)

    问题:当页面高度很大时,放大图片的图层不会跟随着 1.demo.html ;display:none;}          #tip s   {position:absolute;top:40px;l ...

  3. 01 json环境搭建【spring + pringMVC】

    1 导包 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.o ...

  4. 基于IFC标准的4DBIM可视化平台

  5. ruby 类方法、实例方法、类变量

    ###################### #类变量 ###################### class Cloud @@count=0 def initialize(user,passwor ...

  6. VMware Workstation 软件 创建 Ubuntu 14.04虚拟机

    VMware Workstation 软件 创建 Ubuntu 14.04虚拟机 1. 安装VMare Workstation 软件 下载VMware 11 软件 http://www.dntk.or ...

  7. php学习笔记-for循环

    for(init;condition;statement) { func(); } for循环的执行逻辑是先执行一次init语句,然后判断condition是否为true,是则执行func(),再执行 ...

  8. linux文件夹删除、创建

    一.删除文件夹 rm -rf ./html2imag 二.创建文件夹 mkdir html2image

  9. java的泛型的技巧

    最近学习scala,了解了两个概念:class和type,什么是class,就是具有相同的class对象,List<String> ,List<Integer>具有相同的cla ...

  10. netty中的位操作

    看了PoolChunk源码,好多位操作,对这些位操作理解不到位,看起来很是吃力,不知道为什么要这么做,可能是性能更好 1:大小为2 的冥的数加1 怎么操作 size^1; 2: <=比较   m ...