I have a simple powershell command that appends a variable (string) into a .log file:
powershell.exe -command " \\"%V\\" | out-file "C:\\file.