Just a quick script
drop, I am going to polish this up a bit over the coming weeks. This
script will Update all of the WSP’s in the install folder. It will not add new
solutions only update old ones. How it
works:
- Create the following folder structure (where OutofBand is the name of your release):
- Drop your wsps you want to release in the install folder
- Drop your current production wsps in the rollback folder (if you do not have them check this out)
- Create setup.ps1 in the OutofBand folder with the following code
- Do not run this from PowerShell ISE, the Get-Location will fail. This will cause an IISReset
- To deploy your solution files simply run setup.ps1 from SharePoint 2010 Management Shell
- If you need to roll back update the $Rollback variable to $true
#Release Script for SharePoint 2010 wsps
(assumes wsps have already been released)
asnp Microsoft.SharePoint.PowerShell
–erroraction SilentlyContinue
[string]$strDeploymentFiles = Get-Location
-PSProvider FileSystem;
[bool]$Rollback = $false;
if ($Rollback)
{$strDeploymentFiles +=
"\rollback\";}
else
{$strDeploymentFiles +=
"\install\";}
$strd = dir -Recurse $strDeploymentFiles *.wsp;
foreach($wsp in $strd)
{
[string]$strWSPName = $wsp
Update-SPSolution -Identity $strWSPName -LiteralPath
"$strDeploymentFiles$wsp" -Force -GAC
}
No comments:
Post a Comment