Every thing that has power for good has equal power for evil
Spend less than you earn = happiness
Spend more than you earn = misery
Spend less than you earn = happiness
Spend more than you earn = misery

add-content C:\test.txt "some text"Getting the current DateTime is done with 'get-date' and is easily turned into a string.
(get-date).tostring()Strings are concatenated with a plus sign
$dt = (get-date).tostring()Arguments are accessed via the $args array. So assuming the text is passed as an argument.
add-content C:\test.txt $dt + "some text"
$dt = (get-date).tostring()Put it all into a single line and pass the file name as a single path
add-content C:\test.txt $dt + $args[0]
add-content $args[0] ((get-date).tostring()) + $args[1]Save it to C:\AppendToLog.ps1 and then call it.
PS > set-executionpolicy unrestrictedor
PS > & 'C:\AppendToLog.ps1' 'C:\test.log' 'the text to log'
powershell.exe -command "& 'C:\AppendToLog.ps1' 'C:\test.log' 'the text to log'"Jobs a good'un.