Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?xml version="1.0" encoding="utf-8" ?>
- <Feature xmlns="http://schemas.microsoft.com/sharepoint/" Version="1.7.0.0">
- <UpgradeActions>
- <VersionRange BeginVersion="1.0.0.0" EndVersion="1.4.0.0">
- <ApplyElementManifests>
- <ElementManifest Location="module1Elements_v1_2.xml" />
- <ElementManifest Location="module2Elements_v1_3.xml" />
- </ApplyElementManifests>
- </VersionRange>
- <VersionRange BeginVersion="1.7.0.0" >
- <ApplyElementManifests>
- <ElementManifest Location="module1Elements_v1_4.xml" />
- </ApplyElementManifests>
- </VersionRange>
- <VersionRange>
- <CustomUpgradeAction Name="UpgradeElements" />
- </VersionRange>
- </UpgradeActions>
- </Feature>
- <?xml version="1.0" encoding="utf-8"?>
- <Elements xmlns="http://schemas.microsoft.com/sharepoint/">
- <Module Name="ConnectionLauncher" Path="ProductNameConnectionLauncher" Url="ProductName/ConnectionLauncher">
- <File Path ="ProductName.Module1.dll" Url="ProductName.Module1.dll.deploy" IgnoreIfAlreadyExists="TRUE" Type="GhostableInLibrary" />
- <File Path="ProductName.Module2.dll" Url="ProductName.Module.dll.deploy"2 IgnoreIfAlreadyExists="TRUE" Type="Ghostable" />
- <File Path="ProductName.Module3.dll" Url="ProductName.Module3.dll.deploy" IgnoreIfAlreadyExists="TRUE" Type="GhostableInLibrary" />
- <File Path="ProductName.Module4.dll" Url="ProductName.Module4.dll.deploy" IgnoreIfAlreadyExists="TRUE" Type="Ghostable" />
- </Module>
- </Elements>
- $fullName = "$featureName$version.wsp"
- $path = Get-Location
- $fullPath = "$path$fullName"
- Write-Host "Updating $fullPath"
- 'check that it exists
- if(![System.IO.File]::Exists($fullPath)){
- # file with path $path doesn't exist
- Write-Error "The file $fullPath does not exist."
- exit
- }
- Update-SPSolution -Identity $baseName -LiteralPath "$fullPath" -GACDeployment
- 'Now just wait for it to deploy
- Write-Host -NoNewline "Waiting for product deployment..."
- $Solution = get-SpSolution $Name
- while($Solution.JobExists)
- {
- sleep 2
- Write-Host -NoNewline "."
- $Solution = get-SpSolution $Name
- }
- $webApp = [Microsoft.SharePoint.Administration.SPWebApplication]::Lookup("http://localhost")
- $features = $webApp.QueryFeatures($featureGuid, $true)
- foreach($feature in $features){
- Write-Host ("Feature Version " + $feature.Version)
- try
- {
- $feature.Upgrade($true)
- Write-Host ("Upgraded to Feature Version " + $feature.Version)
- }
- catch [Exception]
- {
- Write-Error ("Exception Upgrading")
- echo $_.Exception.GetType().FullName, $_.Exception.Message
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement