Created
March 26, 2013 11:48
-
-
Save ciphertxt/5244814 to your computer and use it in GitHub Desktop.
Saves all farm solutions to the specified directory
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Get-SPFarmSolutions { | |
param ( | |
[string] $directory = $(Read-Host -prompt "Enter a directory (use ""."" for current dir)") | |
) | |
if ($directory.Length -lt 2) { | |
$directory = [string]$pwd + "\\"; | |
} | |
$farm = [Microsoft.SharePoint.Administration.SPFarm]::Local; | |
$solutions = $farm.Solutions; | |
$solutions | ForEach-Object { | |
Write-Host "Found solution $_.name"; | |
$_.SolutionFile.SaveAs($directory + $_.name); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment