0

How Can I refresh 4 lists in PowerShell?

My script doesn't work.

$web = Get-SPWeb http://Server/ListLocation
$list = $web.Lists["Tarefas Geral"]
foreach ($item in $list.Items)
{
  $item.UpdateOverwriteVersion();
}

$list1 = $web.Lists["Tarefas"]
foreach ($item in $list1.Items)
{
  $item.UpdateOverwriteVersion();
}

$list2 = $web.Lists["Tarefas 2"]
foreach ($item in $list2.Items)
{
  $item.UpdateOverwriteVersion();
}

$list3 = $web.Lists["Tarefas Jobs"]
foreach ($item in $list3.Items)
{
  $item.UpdateOverwriteVersion();
}
  • 2
    What is the error you are getting during execution? – UBK May 13 at 20:27

Your Answer

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

Browse other questions tagged or ask your own question.