Hi @Anonymous ,
I am not sure what is the expected outcome.
Maybe this helps:
$filepath = "Junk/someText.txt"
$textToAdd = "Just a test with pipe"
((Get-Content -Path $filepath)[$linenumber - 1]) + $textToAdd | Set-Content -Path $filepath
----------
(If the reply was helpful please don't forget to upvote and/or accept as answer, thank you)
Regards
Andreas Baumgarten