SharePoint PowerShell在SharePoint Product列表里边,然后以管理员权限启动。

1. 添加Solution 到 SharePoint Farm.

Add-SPSolution -LiteralPath "c:\ilt.wsp"

2.获取已添加到SharePoint Farm的Solutions.

Get-SPSolution

3. 部署Solution 到SharePoint。

部署Solution到SharePoint Farm中:

Install-SPSolution -Identity ilt.wsp -GACDeployment

possible errors:

Error Solution
Install-SPSolution : Admin SVC must be running in order to create deployment timer job. Open services.msc and start the service named SharePoint 2010 Administration.

Install-SPSolution : A deployment or retraction is already under way for the solution "webpartmanualdeployment.wsp", and only one deployment or retraction at a time is supported.

Go to Central Administration > System Settings > Manage farm solutions > Cancel / Retract the particular solution

部署Solution到指定的WebApplication中:

Install-SPSolution -Identity ilt.wsp -WebApplication http://sea:31996 -GACDeployment

插曲, 当部署到指定Web Application 遇到错误的时候, 要建一个Dummy data, 制定DeploymentTarget 为 WebApplication: 参考: http://sharedpointers.blogspot.in/2011/03/deploying-solutions-to-specific-web.html

即:

  1. Double click the package
  2. Open the Advanced
  3. add an additional assembly (the solution for example) and mark Deployment Type "Web Application"

4. 升级已部署的Solution

Update-SPSolution -Identity ilt.wsp -LiteralPath "C:\ilt.wsp" -GACDeployment

5.卸载已部署的Solution

Uninstall-SPSolution -Identity ilt.wsp

Web Application 级别的:

Uninstall-SPSolution -Identity ilt.wsp -WebApplication http://sea:31996

6.移除已卸载的Solution

Remove-SPSolution -identity ilt.wsp

Possilble Errors:

Remove-SPSolution: The solution cannot be removed when a job is scheduled or running.

这里介绍一种方法来撤销这个部署的工作。

使用Stsadm -o enumdeployments 获取JobId,:

然后使用 stsadm -o canceldeployment -id JobId 来取消部署工作。

stsadm -o canceldeployment -id 2529c788-971c-46a3-b69f-a2a0a1fcc851

参考: http://blog.sina.com.cn/s/blog_5245a6580100z9bd.html

http://www.cnblogs.com/wsdj-ITtech/archive/2011/05/10/2041843.html

http://www.alexthissen.nl/blogs/main/archive/2007/07/18/removing-malfunctioning-windows-sharepoint-services-solutions.aspx

PowerShell添加和部署WSP的更多相关文章

  1. 使用powershell部署WSP包

    代码如下,先卸载,然后删除,然后添加,然后安装. 卸载之后会重启IIS,所以等待几秒钟,直到卸载完成. 添加snapin $snapin = Get-PSSnapin | Where-Object { ...

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

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

  3. PowerShell命令部署WSP

    转载:http://www.cnblogs.com/ChunLiangZhang/archive/2012/07/18/2597335.html(作者:ChunLiang) 现在可以用SharePoi ...

  4. 不直接登录SharePoint服务器,通过远程直接部署WSP解决方案包

    在这之前不得不说一下Sysinternals,他最初是一个网站,网站上会经常发布一些有用的系统扩展工具,之后运营这个网站的公司被微软收购.像非常著名的Procmon,AutoRuns.Process ...

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

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

  6. 用PowerShell批量部署wsp包

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

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

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

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

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

  9. PowerShell添加或修改注册表开机启动项脚本

    代码如下: $name = Read-Host "请输入开机启动项的名字(随便起)" $value = Read-Host "请输入开机启动项的值" try{ ...

随机推荐

  1. Linux Shell学习笔记(一)

    Shell,见名知意,就是一个作为用户与Linux OS间接口的程序,允许用户向OS输入需要执行的命令.Shell众多,这里只介绍Bash. 0)实验的Shell版本 显示shell版本: /bin/ ...

  2. Thunder团队Alpha周贡献分规则及贡献分分配结果

    小组名称:Thunder 项目名称:爱阅app 组长:王航 成员:李传康.代秋彤.邹双黛.苗威.宋雨.胡佑蓉.杨梓瑞 Alpha周贡献分分配结果

  3. Thunder团队项目视频展示

    视频链接:http://v.youku.com/v_show/id_XMzA5MjMzMzcyMA==.html?spm=a2h3j.8428770.3416059.1 视频简介:通过一个小情景开篇, ...

  4. Object.defineProperty方法 使用

    Object.defineProperty() 方法会直接在一个对象上定义一个新属性,或者修改一个对象的现有属性, 并返回这个对象. 语法: Object.defineProperty(obj, pr ...

  5. Java 常用对象-Date类和Calender类

    2017-11-02 22:29:34 Date类:类 Date 表示特定的瞬间,精确到毫秒. 在 JDK 1.1 之前,类 Date 有两个其他的函数.它允许把日期解释为年.月.日.小时.分钟和秒值 ...

  6. Java 常用对象-Scanner类

    2017-11-02 16:33:11 Scanner类:一个可以使用正则表达式来解析基本类型和字符串的简单文本扫描器. Scanner 使用分隔符模式将其输入分解为标记,默认情况下该分隔符模式与空白 ...

  7. C#异常信息获取

    try { ; / i; } catch (Exception ex) { /** * 1.异常消息 * 2.异常模块名称 * 3.异常方法名称 * 4.异常行号 */ String str = &q ...

  8. getpagesize.c:32: __getpagesize: Assertion `_rtld_global_ro._dl_pagesize != 0' failed

    为arm 编译 mysql , 执行的时候出现了这个问题. 好像是个bug, https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=626379 重新编译 ...

  9. SpringBoot 中常用注解@Controller/@RestController/@RequestMapping介绍

    原文 SpringBoot 中常用注解 @Controller/@RestController/@RequestMapping介绍 @Controller 处理http请求 @Controller / ...

  10. C#,ArcGIS Engine开发入门教程

    C#,ArcGIS Engine开发入门教程 转自:http://blog.csdn.net/yanleigis/article/details/2233674  目录(?)[+] 五实现 一 加载A ...