Hi all,
I am experiencing odd behavior where I can update a List's fields but not a Library's. Ex. I have a Department Managed Metadata field in a Document Library, and a Department Managed Metadata field in a List. Using the following, I can null (clear) the values in the Department field in the list, but it doesn't work in a library. Other scripts are giving me the same issue.
$web = Get-SPWeb http://intranet.yourcompany.com/operations/ $list = $web.lists["Test List"] $items = $list.getItems() $lf = $list.Fields["Department"] foreach($i in $items) { if([String]::IsNullOrEmpty($i["Department"]) -ne $true) { $lf.ParseAndSetValue($i,$null); $i.Update(); } }Please help.
Personal Blog: http://thebitsthatbyte.com