Hi All,
I have an issue using gpg to encrypt files via a Powershell script.
The script contains the path to gpg in the following variable:
$processName = “C:\Program Files (x86)\GnuPG\bin\gpg.exe”
It contains the parameters passed to gpg in the following variable:
$processArgs = “–batch --debug-all -vv --log-file $gpgLogFile --homedir $gpgHomeDir --cipher-algo AES256 --pinentry-mode loopback --passphrase-file $gpgPassphraseFile --symmetric "$filename
”"
Then executes gpg using the command (start-process is used to catch failed encryptions):
$encryptionProcess = (start-process $processName $processArgs -Wait -NoNewWindow)
The script executes, during which gpg-agent is invoked by gpg, and creates an encrypted *.gpg file (tested by decrypting it elsewhere). The script does not progress beyond this point due to gpg-agent still running. If I end the gpg-agent process, the script continues.
Does anyone know if I am missing something here, in how I am executing gpg, that is not closing gpg-agent after completion?
Thank you,
G