When a powershell job is started on a windows machine that has default Ansi Code Page=UTF the job ends with exit code=1
[ERROR SCHEDULER-360 Error when accessing database table SCHEDULER_HISTORY [COM-8007007A The data area passed to a system call is too small. [WideCharToMultiByte]]] can be seen in the task log.
No error should be thrown when a job is executed on a window system with default Ansi Code Page=UTF
set current culture to InvariantCulture
$culture = [System.Globalization.CultureInfo]::InvariantCulture
[System.Threading.Thread]::CurrentThread.CurrentUICulture = $culture
[System.Threading.Thread]::CurrentThread.CurrentCulture = $culture