The thing that jumps out to me is that you are using positional parameters instead of specifying them, and you have -Append first. I've never used Out-File to a UNC path personally. Has this worked in the past and all of the sudden stopped working?
Like what was already said we need to know what kind of object the $test variable holds. Maybe try sending somehting other than an empty row to it or at least put a space between the double quotes.
Write-Output " " | Out-File -FilePath "\\Server\Shared\$test.txt" -Append
$test | Get-Member