I've got a list where theres one column that needs to be updated on a monthly basis (figures get changed). The list already has a person column so over-writing the whole list each month isn't what I'm after.
I have see some examples on updating a field based on a value. So in this example from this site its possible to update items where a value equals something. Which is good because I had a unique 'key' value in the way of a Customer number which I can match on. So basically what I need to do is export a csv of those 2 columns and run through the list see if it matches and update if it does not. My Powershell skills have been a bit neglected of late so its just something I'm trying to put together.
does anyone have an example of a script that when given a CSV it can match and update the 'money' column? thanks
#Get all items in this list and save them to a variable
$items = $list.items
#Go through all items
foreach($item in $items)
{
#If the "Title" column value equals "My first item!" do something with it
if($item["Title"] -eq "My first item!")
{
#Change the value of the "Title" column
$item["Title"] = "My first edited item!"
#Update the item
$item.Update()
}
}