I have a powershell script which imports data from a csv file, and then uploads it into a list.
That works fine, but if the item already exists, for example if the item is already imported, the script still runs and adds all the same data again as seperate items.
Is there a way to get the script to check if that item already exists in the list, if exist, update item, if not add item
I have the 2 scripts that adds and updates, i just need to know how to add the If, else statements
Like the If exists, else – statements from the batch scripting world
Do a CAML query to get the item’ ID
And then ask for it’s “ows_ID” property, if its null, or nothing, then add the item, otherwhise, use batch update to update your item.