title: GPG output missing when running unattended
body: <p>I'm trying to encrypt files through a scheduled task calling gpg2.exe within powershell 2.0</p>
  
  <p>The script/task runs fine when I'm logged in, either through the ISE or by running the task in the windows task scheduler. I'm on Windows Server 2008 and the service account being used is not admin, but has access to all source and destination folders.</p>
  
  <p>When the task runs unattended, the output from gpg doesn't show up in the target directory and there are no errors returned. I've added the user to the security policy to allow it to login as a batch. It is able to write files which currently exist (the source) to the target folder, just not the output from GPG.</p>
  
  <p>The odd thing is that the behaviour is inconsistent, if I log in and out as that system account, sometimes the job will run unattended successfully until the schedule expires and then start erroring on the next schedule. </p>
  
  <p>I'm fairly certain it's a setting around the session since it works all the time when i'm logged in and only in certain scenarios when not. any help would be appreciated.</p>
  
  <p>please see the following example of how i am invoking GPG in powershell (yes, I am a noob :) )</p>
  
  <p>$GPG_Prog='C:\Program Files\GNU\GnuPG\gpg2.exe'</p>
  
  <p>$GPG_Encrypt='-e'</p>
  
  <p>$GPG_Encrypt_to='-r XXXXXXXX'</p>
  
  <p>&amp;"$GPG_Prog" -o C:\location\$File.gpg --batch --quiet --yes "$GPG_Encrypt" "$GPG_Encrypt_to" \source location\$File</p>
  
  <p>Move-Item \$File.gpg \network output location</p>
  
  <p>thanks</p>