1

I've tried this:

$spSite = Get-SPSite -Identity http://mysitecollectionUrl;
$spwWeb = $spSite.OpenWeb();    
$xmlFileContent = GetContent -Path ./myXmlFile.xml
$spwWeb.AllProperties["myPropertyBagKey"] = $xmlFileContent;    
$spwWeb.AllProperties.Update();
$spWWeb.Update();

After runing this snippet nothing is happening. No error, no update of the property bag's value. When I'm trying to edit the property bag using the UI, it does not display the value inside the value preview in the list of property bag. I'm pretty sure that there is something wrong when putting xml like data inside a property bag.

What is the proper way to do it ?

  • Apparently, there is limit 4 Ko for the value of a property bag. Any attempt to edit the value by adding content exceeding that size will fail. – ameliapond Mar 13 at 10:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.