Sign in
Home
Library
Wiki
Learn
Gallery
Downloads
Support
Forums
Blogs
Resources For IT Professionals
United States (English)
Россия (Pусский)
中国(简体中文)
Brasil (Português)
Skip to locale bar
Page Details
First published by
Chen V
(MVP, Microsoft Community Contributor)
When:
2 Sep 2014 3:35 AM
Last revision by
Edward van Biljon
(MVP, Microsoft Community Contributor)
When:
6 Sep 2014 11:30 AM
Revisions:
7
Comments:
4
Options
Revision #1
Wiki
>
TechNet Articles
>
Backup SharePoint Solutions Using PowerShell
>
Revision #1
Backup SharePoint Solutions Using PowerShell
You are currently reviewing an older revision of this page.
Go to current version
Requirement
We need to export all our solutions from Test Environment to Production Farm.
We need to have a Solutions back up folder in both the farm
Environment
SharePoint 2010
PowerShell 2.0
Windows 2008 R2
Solution
We can achieve this using PowerShell
help
Get-Location
-Examples
help
Set-Location
-Examples
help
Get-SPFarm
-Examples
help
New-Item
-Examples
Code
<#
.Synopsis
SharePoint 2010 farm Solutions Back up
.DESCRIPTION
This Script will help SP Admins to back up all WSP files in Folder as a backup.
We can deploy directly from the back up or can be used as required.
.EXAMPLE
Backup-SPSolutions -FolderPath C:\Temp -FolderName 'SPFarmSolutions'
.Contact
chendrayan.exchange@hotmail.com
#>
function
Backup-SPSolutions
{
[
CmdletBinding
(
)
]
Param
(
# Provide Folder path to create a Back up folder
[
Parameter
(
Mandatory
=
$true
,
helpmessage
=
"Enter the valid path"
,
Position
=
0
)
]
[System.String]
$FolderPath
,
# name the back up folder eg: SPFarmSolutionsBackup
[System.String]
$FolderName
)
Begin
{
Write-Host
"Backing Up SharePoint Farm Solutions..."
-ForegroundColor
Yellow
New-Item
$FolderPath\$FolderName
-ItemType
Directory
-Force
Set-Location
$FolderPath\$FolderName
Start-Sleep
2
}
Process
{
(
Get-SPFarm
)
.
Solutions
|
%
{
$Solutions
=
(
Get-Location
)
.
Path
+
“\â€
+
$_
.
Name
;
$_
.
SolutionFile
.
SaveAs
(
$Solutions
)
}
}
End
{
Write-Host
"SharePoint Farm Solutions are backed up...."
-ForegroundColor
Yellow
Invoke-Item
$FolderPath\$FolderName
}
}
Backup-SPSolutions
-FolderPath
C:\Temp
-FolderName
'SPFarmSolutions'
Download
Download Link