SharePoint 2010 PowerShell 系列 之 备份、还原、部署 .WSP
来源:互联网 发布:问卷数据分析 编辑:程序博客网 时间:2024/06/05 23:01
转:http://www.cnblogs.com/Fengger/archive/2012/08/24/2654093.html
PowerShell系列目录
最近在部署测试环境,就顺便把PowerShell 的部署命令了解一下,下面给详细讲解一下关于 PowerShell如何备份、还原及部署.WSP,有人会说,这样的操作通过管理中心可以很容易完成,为什么还要写命令呢?
原因:界面操作是简单,但是执行的时间比较长,没有用命令速度快。命令一次写完后,以后直接拿来用就可以了,一次付出,终身获益......
第一:备份
# Check to ensure Microsoft.SharePoint.PowerShell is loaded$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"}$siteName = "http://SP:999"$path = "C:\site_name_999_test.bak"Write-Host "Starting backup SPSite " $siteName ",please waiting......" -foregroundcolor yellowBackup-SPSite $siteName -Path $path -ForceWrite-Host "Backup SPSite " $siteName "sucessful!" -foregroundcolor green
第二:还原
# Check to ensure Microsoft.SharePoint.PowerShell is loaded$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"}$siteName = "http://SP:666"$path = "C:\Project_201208231718.bak"Write-Host "Starting resotre SPSite " $siteName ",please waiting......" -foregroundcolor yellowRestore-SPSite $siteName -Path $path -ForceWrite-Host "Restore SPSite " $siteName "sucessful!" -foregroundcolor green
第三:部署WSP
# Check to ensure Microsoft.SharePoint.PowerShell is loaded$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"}$solutionPortalPath = "C:\aa.wsp"$solutionVendorPath = "C:\bb.wsp"$solutionPortal = "aa.wsp"$solutionVendor = "bb.wsp"# Add SPSolution Write-Host "Starting Add Solution,please waiting......" -foregroundcolor yellowAdd-SPSolution $solutionPortalPathAdd-SPSolution $solutionVendorPathWrite-Host "Solution Add Sucessful!" -foregroundcolor green# Deploy SolutionInstall-SPSolution –Identity SharePoint2010Solution.wsp –WebApplication http://myserver –GACDeployment# Deploy Sandbox SolutionInstall-SPUserSolution –Identity SharePoint2010Solution.wsp –WebApplication http://myserver –GACDeployment# Update Solution PackageWrite-Host "Starting Update Solution,please waiting......" -foregroundcolor yellowUpdate-SPSolution –Identity $solutionPortal –LiteralPath $solutionPortalPath –GacDeploymentUpdate-SPSolution –Identity $solutionVendor –LiteralPath $solutionVendorPath –GacDeploymentWrite-Host "Solution Update Sucessful!" -foregroundcolor green# Uninstall Solution PackageUninstall-SPSolution –Identity MySharePointSolution.wsp –WebApplication http://myserver# Remove Solution PackageRemove-SPSolution–Identity MySharePointSolution.wsp
以上操作都比较简单,就没有写注释,相信大家一看就懂。
0 0
- SharePoint 2010 PowerShell 系列 之 备份、还原、部署 .WSP
- SharePoint 2010 部署 WSP 包
- Deploy WSP with SharePoint 2010 PowerShell
- sharepoint 2010 PS命令部署wsp包
- SharePoint 2010 PowerShell 系列
- SharePoint 2013 PowerShell命令备份还原报错
- SharePoint 2010/2013备份Farm 级解决方案文件wsp
- SharePoint 2010 WSP包部署过程中究竟发生什么?
- SharePoint部署WSP解决方案包,部署Feature
- 用PowerShell部署WSP(转)
- 用PowerShell批量部署wsp包
- SharePoint 内容部署-PowerShell
- sharepoint 命令行安装、部署、删除wsp包
- SharePoint开发部署WSP解决方案包
- SharePoint开发部署WSP解决方案包
- Sharepoint 2013的WSP方案双机部署
- SharePoint 2010 网站集 备份 还原
- SharePoint 2010 网站备份还原简单介绍
- TDMA信道的概念
- 亲测 S3C2440 dnw下载驱动 win7_x64
- Python 多线程
- Linux系统性能分析工具-操作篇
- java深度探究---Map常见用法,遍历
- SharePoint 2010 PowerShell 系列 之 备份、还原、部署 .WSP
- Spring HTTP Service
- ActiveMQ在JMS中的运用-深入浅出JMS
- 数据库连接池libzdb.2.12在Centos 6.5 64位下的安装
- git 命令大全
- Oracle_Day2 子查询
- 超实用的JavaScript技巧及最佳实践(下)
- 黑马程序员-集合体系汇总
- java学习——instanceof