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? Commented Nov 28, 2017 at 8:48

Your Answer

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.