[SharePoint 2013] Automatic deployment script
Implement automatic deployment through windows task.
Add-PsSnapin Microsoft.SharePoint.PowerShell $today = Get-Date
$targetDir = $today.ToString("yyyyMMdd")
$executeDir = "folder path"
$executeDir += $targetDir + "\" $webURL = "http://server"
$subject = "Automatic Deployment Finished."
$tos = "xxx@xx"
$body = "Solutions deploy successfully.<br/>"
$errorMsg = ""
$sendingEmail = $true if((Test-Path $executeDir) -eq $true){ $ps1s = Get-ChildItem -Path ($executeDir + "*.ps1") if($ps1s.Count -gt 0){ foreach($ps1 in $ps1s){ Invoke-Expression ($executeDir + $ps1.Name)
} $deployingWSPs = GET-SPSolution | Where-Object {$_.JobExists -eq $true} While($deployingWSPs -ne $null -and $deployingWSPs.Count -gt 0){
Start-Sleep -Seconds 600 $deployingWSPs = GET-SPSolution | Where-Object {$_.JobExists -eq $true}
} $deployingWSPs = GET-SPSolution | Where-Object {$_.Deployed -eq $true -and ($_.LastOperationEndTime - $today).Days -eq 0 -and $_.LastOperationResult.ToString() -like "*Failed*" } if($deployingWSPs -ne $null -and $deployingWSPs.Count -gt 0){
$errorMsg += "Exception occur during deployment, please check in CA.<br/>"
} if($error.Count -gt 0){
$errorMsg += "Exception occure during parse command.<br/>"
$errorMsg += $error[$error.Count - 1].Exception.Message
} if($sendingEmail -eq $true){
$web = Get-SPWeb $webURL
if($errorMsg.Length -gt 0){
$body = $errorMsg
}
[Microsoft.SharePoint.Utilities.SPUtility]::SendEmail($web, $true, $false, $tos, $subject, $body) $web.Dispose()
}
}
} exit
[SharePoint 2013] Automatic deployment script的更多相关文章
- SharePoint 2013 Content Deployment 报错 These columns don't currently have unique values
错误描述: These columns don't currently have unique values. Content deployment job 'job name' failed.The ...
- SharePoint 2013 How to Backup Site Collection Automatically With a PowerShell Script
In this post I will introduce a way how to run a script for backing up SharePoint data which could b ...
- Integrating SharePoint 2013 with ADFS and Shibboleth
Time again to attempt to implement that exciting technology, Federation Services (Web Single Sign On ...
- Integrate SharePoint 2013 with Team Foundation Server 2012
Now that SharePoint 2013 is out I want to make sure that I can integrate SharePoint 2013 with Team F ...
- SharePoint 2013 版本功能对比
前言:在SharePoint使用中,经常纠结于版本问题,SharePoint 2013主要有免费的Foundation和收费的标准版.企业版三个版本,他们之间的功能上是不一样的,找了一些资料才发现下面 ...
- SharePoint 2013 扩展查阅项功能
SharePoint 2013的查阅项功能,就是可以扩展其他列表字段为当前列表选项,但是选项太多的时候,会造成选择起来非常麻烦,所以,我们采取JS+Ajax的方式,改善一下这个展示,使操作更加方便. ...
- SharePoint 2013 Excel Services ECMAScript 示例之明日限行
前言:最近遇到一个“明日限行”的功能,北京的交通啊,这个不在今天讨论范围内,暂不吐槽,想想代码开发,还要写WebPart部署,很麻烦,而且部署服务器,需要领导审批,想绕过这个麻烦事儿,就想到客户端了, ...
- 关于在SharePoint 2013(2010)中Javascript如何实现批量批准的自定义操作功能?
1.概述: SharePoint 2013(包括SharePoint 2010)提供了很方便的,多选的界面,但是很多操作还是不能批量进行,比如:批准的功能.如果您要解决方案不关心代码,那么请直接联系作 ...
- [转]安装SharePoint 2013时安装AppFabric失败(错误码:1603)
转自:http://blogs.technet.com/b/praveenh/archive/2013/02/22/sharepoint-2013-prerequisites-fails-with-m ...
随机推荐
- TextView链接点击和长按冲突
1.重写 import android.text.Layout; import android.text.Selection; import android.text.Spannable; impor ...
- [原创]Centos7 内部常用软件升级计划
GCC 当前系统版本 gcc version 4.8.5 20150623 (Red Hat 4.8.5-4) (GCC)
- OSI七层模型及TCP/IP四层模型
1) OSI七层模型及TCP/IP四层模型 OSI七层模型:是国际标准化组织(ISO)制定的一个用于计算机或通信系统间互联的标准体系.它是一个七层的.抽象的模型,不仅包括一系列抽象的术语或概念,也包 ...
- lua52 C API测试代码
//这是一篇lua与C++交互的情景测试 #include <lua.hpp> #include <lauxlib.h> #include <lualib.h> # ...
- keyCode,charCode,which
1.触发顺序keydown keypress keyup,但keypress事件只有输入相关按键才会触发,功能按键不会触发keypress事件(keypress事件有个额外的charCode属性) 2 ...
- Unity3d uGUI适配
Cavas: 1.Render Model设置为:Screen Space- Camera.如果想在UI前面加特效我可以在创建一个摄像机(UIForward)深度大于这个UICamera就行了. 2. ...
- 使用JQuery UI selectmenu, onchange事件失效
今天, 在用jQuery UI的一套东西是发现<select class="dropmenu" onchange="do();"></sele ...
- Tickets——H
H. Tickets Jesus, what a great movie! Thousands of people are rushing to the cinema. However, this i ...
- cxf webservice简单应用
Server端 server部署到一个端口号为80的tomcat中 CXFController.java package com.lwj.controller; import java.io.IOEx ...
- javascript循环和数组的基础练习
九九乘法表 <script> //外层循环行数 for(var i=0; i<=9; i++){ //内曾循环控制每一行的列数 for(var j=0;j<=i; j++){ ...