Using results from add-content to write data to a string

Legacy code. I’m trying to get this string to write the actual number of files that it wrote out. Right now it writes out {0} for each file. What am I missing? How do i get it to say 1 or how do I cleanly remove this?

#Printing output for AGCH_FHMC
$AGCH_FHMC_counter = 0
foreach ($transfer in $transferResult_AGCH_FHMC.Transfers)
{
#Success or error?
if ($transfer.Error -eq $Null)
{
#Print results
Add-content -Path $logpath -value “Upload of {0} succeeded, moving to archive $($transfer.FileName)”
$AGCH_FHMC_counter++
#Upload succeeded, move source file to backup
Move-Item $transfer.FileName $AGCH_FHMC_Archive
}
else
{
#Upload Failed, throw error
Add-content -Path $logpath -value “Upload of {0} failed: {1} $($transfer.FileName) $($transfer.Error.Message)”
}
}
Add-content -Path $logPath -value “$($AGCH_FHMC_counter) files successfully uploaded from AGCH_FHMC.”

You want to use conditional formatting. The “{0}” is a placeholder for your variable you just have to use format string “-f” to use your variable.
The Scripting Guy has some great examples

This is how I tested your concept

$AGCH_FHMC_counter = 0
do{
    Add-content -Path .\test.log  -value ("Upload of {0} succeeded" -f $AGCH_FHMC_counter)
    $AGCH_FHMC_counter++
}
until ($AGCH_FHMC_counter -gt 10)