I had the rather uncommon situation, that my farm contained only one content database before patching. In that case, when SPPatchify imports the csv, Import-Csv returns an object rather than an array. (which causes the iteration to iterate through the object properties rather the array items plus calculating the percentage fails with a 'division by zero' as $db.Count is undefined).
I suggest the following fix (which ensures that $dbs is always an array):
$dbs = @()
$dbs += Import-Csv $files.Fullname
I had the rather uncommon situation, that my farm contained only one content database before patching. In that case, when SPPatchify imports the csv, Import-Csv returns an object rather than an array. (which causes the iteration to iterate through the object properties rather the array items plus calculating the percentage fails with a 'division by zero' as $db.Count is undefined).
I suggest the following fix (which ensures that $dbs is always an array): $dbs = @() $dbs += Import-Csv $files.Fullname