转载: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. mysql工具Navicat批量执行SQL语句

    例如:我现在要同时执行这么多语句 update community set xqmc=replace(xqmc,' ',''); update community set xqbm=replace(x ...

  2. ListView里面adapter的不同分类的item

    public class PlayAdapter extends BaseAdapter { /** * 标题的item */ public static final int ITEM_TITLE = ...

  3. VS2012新建网站出现(1)的解决方案

    1.用记事本打开以下文件: D:\Users\lyn\Documents\IISExpress\config\applicationhost.config 2.删除sites结点下的所有site结点:

  4. 仿射变换详解 warpAffine

    转自 http://www.cnblogs.com/dupuleng/articles/4055020.html 博客园 首页 新随笔 联系 管理 订阅 随笔- 1  文章- 185  评论- 14  ...

  5. 除了ROS ,机器人自主定位导航还能怎么做?

    博客转载自:https://www.leiphone.com/news/201609/10QD7yp7JFV9H9Ni.html 雷锋网(公众号:雷锋网)按:本文作者科技剪刀手,思岚科技技术顾问. 随 ...

  6. oracle环境变量配置

    1.右键我的电脑--->属性--->高级系统设置 2.环境变量---->新建 总共配置三个变量(1) 变量名 ORACLE_HOME 变量值 G:\app\TH\product\11 ...

  7. R: 关于文件 文件夹的处理:file.show() dir.create().....

    文件管理主要函数: setwd( ):设定R软件当前工作目录.getwd( ):查看R软件当前工作目录.list.files( ): 查看当前目录下文件.file.show( ): 显示文件.file ...

  8. p4322 [JSOI2016]最佳团体

    传送门 分析 我们不难发现这是一棵树 于是01分数规划然后树上dp即可 代码 #include<iostream> #include<cstdio> #include<c ...

  9. android listview addHeaderView和addFooterView的注意事项

    1. item内如果有button等控件时,在监听listview的onitemclick事件时,焦点会被item内的button. imagebutton等控件抢走,从而导致在listview设置了 ...

  10. android studio中使用x5 webview来读写cookies的问题

    本人新手,刚接触AS也没有多久,记录下两个问题. 1. 怎么在android studio中写入cookies 把写入cookies的动作放在了主界面的onCreate事件中了,看了腾讯的说明,说是要 ...