PowerShell添加和部署WSP
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
即:
- Double click the package
- Open the Advanced
- 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;
PowerShell添加和部署WSP的更多相关文章
- 使用powershell部署WSP包
代码如下,先卸载,然后删除,然后添加,然后安装. 卸载之后会重启IIS,所以等待几秒钟,直到卸载完成. 添加snapin $snapin = Get-PSSnapin | Where-Object { ...
- SharePoint 2010 PowerShell 系列 之 备份、还原、部署 .WSP
转:http://www.cnblogs.com/Fengger/archive/2012/08/24/2654093.html PowerShell系列目录 最近在部署测试环境,就顺便把PowerS ...
- PowerShell命令部署WSP
转载:http://www.cnblogs.com/ChunLiangZhang/archive/2012/07/18/2597335.html(作者:ChunLiang) 现在可以用SharePoi ...
- 不直接登录SharePoint服务器,通过远程直接部署WSP解决方案包
在这之前不得不说一下Sysinternals,他最初是一个网站,网站上会经常发布一些有用的系统扩展工具,之后运营这个网站的公司被微软收购.像非常著名的Procmon,AutoRuns.Process ...
- SharePoint 2010 使用Install-SPSolution部署wsp包状态一直是”正在部署”
1.服务器场信息如下: 2.使用下面命令部署,状态一直是"正在部署" Install-SPSolution –Identity xxxx.wsp –WebApplication h ...
- 用PowerShell批量部署wsp包
转:http://www.xuebuyuan.com/168337.html 提供wsp部署的参数: $wsppath:wsp文件所在的路径,如"c:\" $wspnames:路径 ...
- 转载 SharePoint开发部署WSP解决方案包
转载原出处: http://642197992.blog.51cto.com/319331/1582731 注:本文所讲内容以SharePoint2013版本为例,开发工具以VS2013为基础.历史版 ...
- 使用命令部署wsp包,并将其部署到不同的web应用程序
http://www.c-sharpcorner.com/uploadfile/anavijai/how-to-deploy-a-wsp-using-powershell-in-sharepoint- ...
- PowerShell添加或修改注册表开机启动项脚本
代码如下: $name = Read-Host "请输入开机启动项的名字(随便起)" $value = Read-Host "请输入开机启动项的值" try{ ...
随机推荐
- Jmeter ResponseAssertion 【Ignore Status】
在Jmeter源码中AssertionGui.java中,定义了Ignore Status的作用域 /** * Checkbox to indicate whether the response sh ...
- Qt5_程序发布
ZC: deploy ==> 部署 1.文件夹platforms 该文件夹 来自 Qt安装目录:F:\ZC_software_installDir\Qt5.3.2_vs2010\5.3\msvc ...
- C#快速生成数据数组
需求:生成一个数组,数组里面的值为1-100实现方式:拿到这个需求很多朋友可能会想到一个快速实现的方式如下: ]; ;i<=;i++){ arr[i]=i; } 但是C#提供了一个快速生成的方式 ...
- PHP标准库SPL
SPL是Standard PHP Library(PHP标准库)的缩写.用来解决典型(常见)问题(common problems)的一组接口与类的集合 典型问题(common problems) - ...
- spring boot: freemarket模板引擎
spring boot: freemarket模板引擎 freemarket模板引擎,可以和thymeleaf模板引擎共存 pom.xml引入 <!-- Freemarket --> &l ...
- C#开发框架学习
C# 开源框架(整理) Json.NET http://json.codeplex.com/ Json.Net 是一个读写Json效率比较高的.Net框架.Json.Net 使得在.Net环境下使用J ...
- Leetcode 96
class Solution { public: int numTrees(int n) { ]; dp[] = ; dp[] = ; dp[] = ; ;i <= n;i++){ ; ;j & ...
- 使用HttpClient 发送 GET、POST、PUT、Delete请求及文件上传
package org.caeit.cloud.dev.util; import java.io.File; import java.io.IOException; import java.io.Un ...
- Get和Load的区别----hibernate
Get和Load的区别
- 算法笔记_025:字符串的全排列(Java)
目录 1 问题描述 2 解决方案 2.1 递归实现 2.2 字典序排列实现 1 问题描述 输入一个字符串,打印出该字符串的所有排列.例如,输入字符串”abc”,则输出有字符’a’,’b’,’c’所 ...