Write Hostname to a file (append)

After a successful installation i want write the computername into a txt file on a networkshare.

What is the best way for that? Could someone help?

$envcomputername | set-content -path "<path on networkshare>"

You might want to add error handling too.

1 Like

Thank you very much !! This is it !