Simpler:
$Array | Tee-Object -Append c:\temp\Version.txt
See https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.utility/tee-object