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

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()
  • 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 '17 at 8:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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