Powershell Script Sharepoint Online | how to change a value in a list item (column)?

Your code should be like:

$sourceWebURL = "<Site URL>"
$sourceListName = "<List Name>"

$spSourceWeb = Get-SPWeb $sourceWebURL
$spSourceList = $spSourceWeb.Lists($sourceListName)
$spSourceItems = $spSourceList.Items | where {$_('Category') -eq "A"}

$spSourceItems | ForEach-Object {
    $_('Category') = "B"
    $_.update()
}

Reference: How to update list item on conditional basis using PowerShell in SharePoint 2010


Or based on your code, you can modify it like:

ForEach($item in $ListItems)
{
    if($item("Category") -eq "A") 
    {
         $item("Category") = "B";
         $item.Update();
    }

}