I have a CSV file that looks like:
Initials,Size excl. Backup/Pst,Number of warnings
USER1,100,1
USER2,100,1
USER4,400,2
I would like to increase the value "Number of warnings" by 1 so I will end up with:
Initials,Size excl. Backup/Pst,Number of warnings
USER1,100,2
USER2,100,2
USER4,400,3
I have tried, but not succeeded.
I have also tried putting it in array, but can't get it working.
$Temp = Import-Csv $Database | foreach {$_.'Number of warnings' +1}
But this does 2 things:
only adds 1 to the end of the number so 1 becomes 11 and 2 becomes 21 (as it was a string)
The output is only the "Number of warnings" column - the rest of my information seems to be gone
foreach {$_.'Number of warnings'++}
toostring
to anint
and throws an error about the++
operator only working on numbers.