1

I have a doc lib Test and column employee. I want to run powershell which check if any column (employee) has empty value then update the field value with "AAA". Under document library we have document sets and for each doc sets we have properties(employee) which is field(employee) in library. now need to update that property. How to achieve this?

Thanks

1 Answer 1

2

Try with this?

    $web = Get-SPWeb http://YourServer/
    $list = $web.Lists["Test"]
    foreach ($item in $list.Items)
    {
      if([string]::IsNullOrEmpty($item["employee"]))
      {
        $item["employee"] = "AAA";
        $item.Update();
       }
    }
    $web.Dispose()
1
  • there is little correction in question. Under document library we have document sets and for each doc sets we have properties which is field in library. now need to update that property. does it still work?
    – Brishal
    Nov 28, 2017 at 8:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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