使用powershell部署WSP包
代码如下,先卸载,然后删除,然后添加,然后安装。
卸载之后会重启IIS,所以等待几秒钟,直到卸载完成。
添加snapin
$snapin = Get-PSSnapin | Where-Object {$_.Name -eq 'Microsoft.SharePoint.Powershell'}
if ($snapin -eq $null)
{
Write-Host "Loading SharePoint Powershell Snapin..."
Add-PSSnapin "Microsoft.SharePoint.Powershell"
Write-Host "SharePoint Powershell Snapin Loaded"
}
部署代码
################
#Deploy Timejob#
write-host ""
write-host "--------------------------" -foregroundcolor green
write-host "Starting Install Solution!" -foregroundcolor green
$webApplication = "http://xxxx/"
$wspName= "TimeJob.wsp"
$sln = get-spsolution -identity $wspName
Uninstall-SPSolution -Identity $wspName -confirm:$false
while($sln.JobExists) {
write-host "Uninstall in progress..." -foregroundcolor yellow
start-sleep -s 5
}
Remove-SPSolution -identity $wspName -confirm:$false
write-host "Solution Removed!" -foregroundcolor green
$webpartPath="C:\Sharepoint\Deploy\WSP\" + $wspName
Add-SPSolution $webpartPath
Install-SPSolution -Identity $wspName -GACDeployment
write-host "Solution" $wspName "Installation Completed!" -foregroundcolor green
write-host "--------------------------" -foregroundcolor green
使用powershell部署WSP包的更多相关文章
- SharePoint 2010 使用Install-SPSolution部署wsp包状态一直是”正在部署”
1.服务器场信息如下: 2.使用下面命令部署,状态一直是"正在部署" Install-SPSolution –Identity xxxx.wsp –WebApplication h ...
- SharePoint 2010 部署 WSP 包
转:http://www.cnblogs.com/myheaven/archive/2011/05/19/2051180.html .net在工程的下面生成了WSP包,在Debug下面.需要放到生产环 ...
- 使用命令部署wsp包,并将其部署到不同的web应用程序
http://www.c-sharpcorner.com/uploadfile/anavijai/how-to-deploy-a-wsp-using-powershell-in-sharepoint- ...
- 用PowerShell批量部署wsp包
转:http://www.xuebuyuan.com/168337.html 提供wsp部署的参数: $wsppath:wsp文件所在的路径,如"c:\" $wspnames:路径 ...
- 不直接登录SharePoint服务器,通过远程直接部署WSP解决方案包
在这之前不得不说一下Sysinternals,他最初是一个网站,网站上会经常发布一些有用的系统扩展工具,之后运营这个网站的公司被微软收购.像非常著名的Procmon,AutoRuns.Process ...
- SharePoint 2010 WSP包部署过程中究竟发生什么?
转:http://www.xue163.com/158/6/1585365.html 在SharePoint 2010中,我们可以使用Visual Studio 2010轻松创建WSP包来安装Web ...
- 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 Server 2010)
转:http://technet.microsoft.com/zh-cn/library/cc262995(v=office.14).aspx 本文介绍各个解决方案包,及其在 Microsoft Sh ...
随机推荐
- SQLServer学习笔记系列2
一.写在前面的话 继上一次SQLServer学习笔记系列1http://www.cnblogs.com/liupeng61624/p/4354983.html以后,继续学习Sqlserver,一步一步 ...
- 微信支付v3发布到iis时的证书问题
一开始报“出现了内部错误” 解决方法是 方法一 var cer = new X509Certificate(certpath, password,X509KeyStorageFlags.Machine ...
- Web性能测试参数
1.前言 最近在项目中引入了keyless,需要测试一下对web的性能影响.常见的web测试工具有ab.siege.http_load等.我用的是Apache的ab测试工具.在测试web性能之前,首先 ...
- 如何给wordpress首页自动显示文章内容的第一个图片
敏捷个人手机应用中使用到的数据来源于wordpress中,因为自己写的页面,所以可以自己写代码获取文章内容的第一个图片作为文章缩略图来显示,这样用户看到首页时图文并茂,感觉会好一些. 现在后台简单的使 ...
- Android Fragment 解析和使用
Android Fragment的生命周期和Activity类似,实际可能会涉及到数据传递,onSaveInstanceState的状态保存,FragmentManager的管理和Transactio ...
- 在SQL Server 2014里可更新的列存储索引 (Updateable Column Store Indexes)
传统的关系数据库服务引擎往往并不是对超大量数据进行分析计算的最佳平台,为此,SQL Server中开发了分析服务引擎去对大笔数据进行分析计算.当然,对于数据的存放平台SQL Server数据库引擎而言 ...
- 【Swift学习】Swift编程之旅---类和结构体(十三)
与其他编程语言所不同的是,Swift 并不要求你为自定义类和结构去创建独立的接口和实现文件.你所要做的是在一个单一文件中定义一个类或者结构体,系统将会自动生成面向其它代码的外部接口. 注意:通常一个类 ...
- Maven提高篇系列之(四)——使用Profile
这是一个Maven提高篇的系列,包含有以下文章: Maven提高篇系列之(一)——多模块 vs 继承 Maven提高篇系列之(二)——配置Plugin到某个Phase(以Selenium集成测试为例) ...
- 【Win10】在应用中使用 SQLite 数据库
在绝大多数应用中,免不了要做的一项就是设置这样的本地数据存储.简单的数据存储我们可以使用 LocalSettings 或者 IsolatedStorageFile(独立存储)等等的方式来进行本地数据存 ...
- Handler "BlockViewHandler" has a bad module "ManagedPipelineHandler" in its module list
当你的ASP.NET MVC项跑在IIS时,出现如标题Handler "BlockViewHandler" has a bad module "ManagedPipeli ...