Hi all,
i have a sharepoint 2010 site with blog, blog contains few posts with comments. I need to modify comment property via powershel.
Have used the following code:
$spWeb = Get-SPWeb http://portal/strategy \\get the site
$dd = $spWeb.Lists["Comments"] \\get the list of all comments
$dd.Items[1] \\ here i select required comment
Now i can see it's properties like
Xml:
<z:row xmlns:z='#RowsetSchema' ows_ID='19' ows_ContentTypeId='0x0111008F1E084351F D240821BA37C4537E336' ows_ContentType='Comment' ows_Title='test' ows_Modified=
'2012-09-28 14:42:25' ows_Created='2012-09-28 14:29:53' ows_Author='1;#spsadmin' ... />
So the problem is so i can't modify that ows property, like ows_Created or ows_Modified via powershell.
Thanks.
$dd.GetItemById(1)["Created"] = Date– eirikb Sep 28 '12 at 14:56PS C:\Users\spsadmin> $dd.GetItemById(19)["Created"] = 2012-09-27 **Unable to index into an object of type** Microsoft.SharePoint.SPListItem. At line:1 char:21 + $dd.GetItemById(19)[ <<<< "Created"] = 2012-09-27 + CategoryInfo : InvalidOperation: (Created:String) [], RuntimeException + FullyQualifiedErrorId : CannotIndex– Sergey Sep 28 '12 at 16:12Dateas I did in my example, does it work? – eirikb Sep 28 '12 at 18:49