I have got a Sharepoint list. I updeted it in job everyday and everyday refresh by powershell. I have got some column on this sharepoint list. One of this column called [nazwazdarzenia]. And the code which works for today great was:
# Delete existing List Data, If not required remove this line
$Items = $list.GetItems()
$Items | ForEach-Object{
$list.GetItemById($_.Id).Delete()}
But now, I want to delete everyrecord without record which have got in column [nazwazdarzenia] =! "Szkolenie". So delete all records without records with column [nazwazdarzenia] not equal "Szkolenie". What If I should add to PowerShell to dellete all records without "Szkolenie". Please help.