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 ?