Pages

Sunday, June 5, 2011

Schedule SharePoint Backup using Powershell

Here’s a script you can use to deploy your SharePoint 2010 Solutions:

Add this lines of text to notepad and save the file with a .ps1 extension

_______________________________________________________________________
Add-PSSnapin Microsoft.SharePoint.PowerShell –ErrorAction SilentlyContinue

$SolutionPackageName = “YourSolutionPackageName.WSP”

$SolutionPackagePath “YourSolutionPackageName\YourSolutionPackageName.wsp”

$solution = Get-SPSolution |where-object {S_. Name -eq $SolutionPackageName}

if ($solution -ne $null) (

if($solution.Deployed -eq $true){

Uninstall-SPSolution -Identity SSolutionPackageName -Local -Confirm:$false

}

Remove-SPSolution -Identity $SolutionPackageName -Confirm:$false

Write-Host “Installing Solution...”

Add-SPSolution -LiteralPath $SolutionPackagePath

Write-Host “Deploying Solution...”

Install -SPSolution -Identity $SolutionPackageName -Local –GACDeployment

(make sure that PowerShell allows scripts using Set-ExecutionPolicy = Unrestricted)

No comments:

Post a Comment