powershell - outfile question...
hi; i have line of code writes $computer variable text file , works me; however, i'd add $date + times variables along $computer each line in text file contains hostname along date , time. possible? in advance, doing head in $computer | out-file c:\vncrestarted.txt -append i of this. i've adjusted code include doubled quoted texty bits... will save copy and email myself ;) # setup trap catch exceptions trap [exception] { write-error $("trapped: " + $_.exception.message); } # read computers text file $computers = get-content c:\computers.txt; $start = $true; # setup service array service names want check running $servicearray = 'uvnc_service'; # powershell knows it's array working simple foreach($computer in $computers) { write-host "checking $computer"; $objwmiservice = get-wmiobject -class win32_service -computer $computer foreach($service in $ob...