title: Running SSIS packages with Powershell and piping output to a log file -> Spaces inserted into log results
body: <p>I've got a powershell script on my windows server running an SSIS package, using an xml config that outputs to a log file. </p>
  
  <p>Sometimes when I run this script, the output to the log file doesn't seem to be written to the log correctly, and it appears as though the powershell script inserts spaces between each character of the log as it's being written. </p>
  
  <p>Does anyone know why this behavior may be occurring?</p>
  
  <p>My Powershell script:</p>
  
  <pre><code>dtexec /f "D:/Batch Jobs/ThisJob/ThisJob.dtsx" /conf "D:\Batch Jobs\ThisJob\ThisJob.dtsconfig."  &gt;&gt; "D:/Batch Jobs/ThisJob/ThisJob_executionlog.txt"
  </code></pre>
  
  <p>Example of normal output:</p>
  
  <blockquote>
    <p>Microsoft (R) SQL Server Execute Package Utility Version 12.0.4100.1
    for 64-bit Copyright (C) Microsoft Corporation. All rights reserved.</p>
    
    <p>Started:  11:42:19 AM Progress: 2016-05-26 11:42:19.53    Source:
    AM_AGENT     Validating: 0% complete</p>
  </blockquote>
  
  <p>Example of powershell output peppered with spaces:</p>
  
  <blockquote>
    <p>M i c r o s o f t   ( R )   S Q L   S e r v e r   E x e c u t e   P a
    c k a g e   U t i l i t y     V e r s i o n   1 2 . 0 . 4 1 0 0 . 1<br>
    f o r   6 4 - b i t     C o p y r i g h t   ( C )   M i c r o s o f t 
    C o r p o r a t i o n .   A l l   r i g h t s   r e s e r v e d . </p>
  
  <pre><code> S t a r t e d :     1 2 : 5 1 : 1 3   P M     P r o g r e s s :   2 0 1 6 - 0 5 - 2 6   1 2 : 5 1 : 1 3 . 8 0 
  
     S o u r c e :   A M _ A G E N T   
  
     V a l i d a t i n g :   0 %   c o m p l e t e     E n d   P r o g r e s s     P r o g r e s s :   2 0 1 6 - 0 5 - 2 6   1 2 : 5 1 : 1 3 . 8 6 
  
     S o u r c e :   A M _ A G E N T   
  
     V a l i d a t i n g :   5 0 %   c o m p l e t e     E n d   P r o g r e s s     P r o g r e s s :   2 0 1 6 - 0 5 - 2 6   1 2 : 5 1 :
  </code></pre>
    
    <p>1 3 . 8 6 </p>
  
  <pre><code>   S o u r c e :   A M _ A G E N T   
  
     V a l i d a t i n g :   1 0 0 %   c o m p l e t e     E n d   P r o g r e s s     P r o g r e s s :   2 0 1 6 - 0 5 - 2 6   1 2 : 5 1
  </code></pre>
    
    <p>: 1 3 . 8 6 </p>
  
  <pre><code>   S o u r c e :   A M _ A
  </code></pre>
  </blockquote>