Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I have the following situation:

solution1.wsp that has a document library with files inside (I use a module element for adding new files to the feature)

and solution2.wsp that has a document library with different files inside (with new files in a module)

I have tried to use the Update-SPSolution cmdlet, but with no success. The document library items were not changed.

I have investigated Update-SPSolution's behavior and it is probably impossible to add new items (in a module element).

Is it possible to add new items to a feature via a module and then do Update-SPSolution operation?

share|improve this question
add comment

3 Answers

The detailed description of the Update-SPSolution at MSDN - Update-SPSolution for both SharePoint 2010 and 2013 says:

The Update-SPSolution cmdlet upgrades a deployed SharePoint solution in the farm. Use this cmdlet only if a new solution contains the same set of files and features as the deployed solution. If files and features are different, the solution must be retracted and redeployed by using the Uninstall-SPSolution and Install-SPSolution cmdlets, respectively.

So unfortunately, no, you can't add new files to a document library via a module by using Update-SPSolution.

share|improve this answer
    
I have find answer to my question. Yes, you can. You can use <ApplyElementManifests> element. msdn.microsoft.com/en-us/library/ee537916(v=office.14).aspx –  user13383 Dec 4 '12 at 16:30
    
This will add the files from both of your elements.xml files, not just replace the old ones with the new ones. –  RJ Cuthbertson Dec 4 '12 at 16:48
    
But we can use this element(<ApplyElementManifests>) and use file with same name elements.xml but with different content to replace old file elements.xml with new file elements.xml. All new items that we will add actually appears in folder of the new feature and after upgrade command my document library(like in my example) contains new files. –  user13383 Dec 6 '12 at 13:36
add comment

You can't add new files to document library using Update-SPSolution but instead you can build a feature that creates (or to an already created document library) a document library including some default documents already in the library. The feature should be web scoped, include a list instance element and a module element with all the necessary content files. By changing the URL parameter in the module you can ensure that the documents are placed in the new/existing document library.

Here is a smart example on how to do it.

share|improve this answer
    
I have find answer to my question. Yes, you can. You can use <ApplyElementManifests> element. msdn.microsoft.com/en-us/library/ee537916(v=office.14).aspx –  user13383 Dec 4 '12 at 16:32
add comment
up vote 0 down vote accepted

I have find answer to my question. Yes, you can. You can use element. msdn.microsoft.com/en-us/library/ee537916(v=office.14).aspx And use same file elements.xml with new content.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.