$td
is an array of objects, not ints. You can store whatever you want in it.
$td = @()
$td += 10
$td += "Hello"
$td += 45.67
If you want to store only ints then type it explicitly.
[int[]] $td = @()
$td += 10
$td += "Hello" # Error
But later in your code it looks like $td
should be an array of strings since you're converting a date to a formatted string.
Moving on to your next issue, you're using a comma in the for
and you need a semicolon. Commas are used to separate array elements so PS is seeing an array.
[string[]] $td = @()
$test = 4
for ($x = 1; $x -le $test; $x++) {
$td += (Get-Date).AddDays(-$x).ToString('dd/MM/yyyy')
}