-
-
WSPBuilder工具命令方式,相关链接CodePlex项目
-
WSPBuilderExtension,一个VS插件,这个比上面的方式更简单
-
SharePoint Software Factory(SP|SF),这是一个Visual Studio扩展工具,最新版本已经支持了VS2013版本,相关链接VS扩展,CodePlex项目地址
-
当然VS2013开发SharePoint解决方案已经可以从上下文菜单中直接部署了。在部署过程中会自动打包解决方案。
-
当然一些其他第三方的cab生成工具也能帮助我们生成wsp文件,但操作过程还是繁琐复杂一些。
-
1
2
|
Add-PSSnapin
Microsoft.SharePoint.PowerShell
backup-spsite -identity
$args
[0] -path
$args
[1] -force
|
1
2
3
4
5
6
7
8
|
@echo off
SET SOURCE_SITE=
SET DEST=C:\backup\RZH-SP-204_%date:~0,10%.bak
SET LOG=C:\backup\BackupLog.txt
echo %DATE% %time:~,5% :开始备份网站:%SOURCE_SITE%>> %LOG%
powershell -command C:\backup.ps1 %SOURCE_SITE% %DEST%
echo %DATE% %time:~,5% :网站:%SOURCE_SITE%备份完成>> %LOG%
@echo on
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
Add-PSSnapin
Microsoft.SharePoint.PowerShell
$solutionName
=
"SharePointProject2.wsp"
$webUrl
=
"http://wisdom-moss/"
$path
=
Split-Path
-Parent
$MyInvocation
.MyCommand.Definition
$solution
=
Get-SPSolution
| select name
foreach
(
$s
in
$solution
){
if
(
$s
-match
$solutionName
){
Write-Host
-ForegroundColor Green
"Solution '$solutionName' was existed."
$deployed
=
Get-SPSolution
-Identity
$solutionName
| select deployed
if
(
$deployed
.Deployed){
Write-Host
-ForegroundColor Green
"Start uninstall solution..."
Uninstall-SPSolution -Identity
$solutionName
-Confirm:
$false
-Verbose -WebApplication
$webUrl
#sleep 30s, need uninstall over.
Start-Sleep
-s 30
Write-Host
-ForegroundColor Green
"End uninstall solution!"
}
Write-Host
-ForegroundColor Green
"Start remove solution..."
Remove-SPSolution
-Identity
$solutionName
-Confirm:
$false
Write-Host
-ForegroundColor Green
"End remove solution!"
}
}
Write-Host
-ForegroundColor Green
"Start add solution..."
Add-SPSolution
-LiteralPath (
$path
+
'\'
+
$solutionName
)
Write-Host
-ForegroundColor Green
"End add solution!"
Write-Host
-ForegroundColor Green
"Start deploy solution..."
Install-SPSolution -Identity
$solutionName
-WebApplication
$webUrl
-FullTrustBinDeployment
Write-Host
-ForegroundColor Green
"End deploy solution!"
Write-Host
-ForegroundColor Green
"End all executed."
|
