Logging Powershell command
I have put together my own powershell script that will disable computers.I would like to create a log file of what computers are actually disabled.
<command> | Out-File -append C:\log.txt
The above puts a list of computers disabled into a text file. I would like it so it puts a date the command was actioned next to the computer name.
Also it puts headings above the computer names like the below. Does anyone know if its possible so it doesn't keep putting duplicating the heading please?