SyntaxFix
Write A Post
Hire A Developer
Questions
To embed this in your script, you can do it like this:
Write-Output $server.name | Out-File '(Your Path)\Servers.txt' -Append
That should do the trick.