AnsweredAssumed Answered

problem formatting text in text file copied to c2osvd

Question asked by samuel.leibowitz on May 9, 2016
Latest reply on Jun 15, 2016 by samuel.leibowitz

Hi folks,

 

I have a process which executes a script on an agent host. The script itself is local to the server, so I'm calling it via an in-line batch which looks like this:

 

echo powershell.exe -ExecutionPolicy Bypass -file %1 -LOG %3 -share %2 -SQLSERVER %4

powershell.exe -ExecutionPolicy Bypass -file %1 -LOG %3 -share %2 -SQLSERVER %4

 

set result=%ERRORLEVEL%

 

echo /A copy %3 %C2OSVD%\log

copy /A %3 %C2OSVD%\log

 

if %result% neq 0 exit /b 1

 

If I go onto the agent host and dig up the log file, it looks like this:

 

[2016-05-09 11:11:36][Kerberos_test.ps1   ] -------------------------
[2016-05-09 11:11:36][Kerberos_test.ps1   ] Script started - Kerberos_test.ps1
[2016-05-09 11:11:36][Kerberos_test.ps1   ] Run by:    SCRulesAcct
[2016-05-09 11:11:36][Kerberos_test.ps1   ]
(...snip)

 

 

But when the agent picks up the text of that file and the orchestrator reads back the results, the variable in the operator dataset looks like this:

ÿþ[   - -9   :  :  ][Kerberos_test.ps    ]          -------------------------
[   - -9   :  :  ][Kerberos_test.ps    ]          Script started - Kerberos_test.ps
[   - -9   :  :  ][Kerberos_test.ps    ]          Run by:    SCRulesAcct
[   - -9   :  :  ][Kerberos_test.ps    ]

(...snip)

Any idea what could be causing this? For the record, the powershell script is writing  a plain old text file. I opened it in Notepad++ to get a better look at it, and it looks like it has regular old CRLF line terminations, and nothing else out of the ordinary.

 

Thanks,

Sam

Outcomes