I am a Powershell noobie and I am currently writing my second script so bear with me. I am trying to do a
write-host and output my write-host message along with a time stamp and what computer is completing my various script blocks to a text file and I am having issues with which syntax to make things work.
I tried the following for testing purposes. This will be going to a server once I get the Syntax down – for now it goes to my local
write-host "folders created successfully $env:computername" >> c:\scripts\testlog.txt
The behavior I'm seeing is the text file is being created but there's no contents in it – all blank.