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. python 压缩tar 包

    import tarfile import os def make_targz(output_filename, source_dir): print("doing!") with ...

  2. python 时间戳转元组

    #!/usr/bin/python # -*- coding: UTF- -*- import time localtime = time.localtime(time.time()) print(& ...

  3. kali 下程序卸载方法

    ali中主要为2种卸载方法:1.apt2.dpkg 使用apt的方式有:apt-get remove [package]apt-get remove --purge # ------(package ...

  4. pip 安装pandas报UnicodeDecodeError: 'ascii' codec can't decode byte 0xd5错

    当Python在window环境中通过pip安装pandas报标题这样的错,主要是因为python默认编码格式是:ascii 在https://www.python.org/dev/peps/pep- ...

  5. django字段查询参数及聚合函数

    字段查询是指如何指定SQL WHERE子句的内容.它们用作QuerySet的filter(), exclude()和get()方法的关键字参数. 默认查找类型为exact. 下表列出了所有的字段查询参 ...

  6. 基于 Flutter 以两种方式实现App主题切换

    概述 App主题切换已经成为了一种流行的用户体验,丰富了应用整体UI视觉效果.例如,白天夜间模式切换.实现该功能的思想其实不难,就是将涉及主题的资源文件进行全局替换更新.说到这里,我想你肯定能联想到一 ...

  7. Redis<六> Key通用操作

    1). KEYS pattern : 查找所有符合给定模式 pattern 的 key . 如 keys * , keys *list* 2). DEL key [key ...] : 删除给定的一个 ...

  8. java反射究竟消耗多少效率

    原文出处 一直以来都对Java反射究竟消耗了多少效率很感兴趣,今晚总算有空进行了一下测试 测试被调用的类和方法 package com.spring.scran; public class TestM ...

  9. 20170528xlVBA凑数一例

    Public Sub MakeUp() Dim Sht As Worksheet Set Sht = ThisWorkbook.Worksheets("设置") Dim Total ...

  10. spoj Prime Generator

    题意:判断ll-rr范围内的质数. 一个个用miller-rabin算法判断 //#pragma comment(linker,"/STACK:1024000000,1024000000&q ...