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
Post an article
Translate this page
Powered by
Microsoft® Translator
Wikis - 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
Subscribe to Article (RSS)
Share this
Engage!
Wiki Ninjas Blog
(
Announcements
)
Wiki Ninjas on Twitter
TechNet Wiki Discussion Forum
Can You Improve This Article?
Positively!
Click Sign In to add the tip, solution, correction or comment that will help other users.
Report inappropriate content using
these instructions
.
Wiki
>
TechNet Articles
>
Backup SharePoint Solutions Using PowerShell
Backup SharePoint Solutions Using PowerShell
Article
History
Backup SharePoint Solutions Using PowerShell
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
en-US
,
has code
,
PowerShell
,
SharePoint
Sort by:
Published Date
|
Most Recent
|
Most Useful
Comments
Edward van Biljon
2 Sep 2014 4:40 AM
thanks
Page 1 of 1 (1 items)