I Was decrypting a file.pgp file, and the file is present in the directed. The powershell script is able to read the name of the file but not able to open it. it says below error:
gpg.exe : gpg: can't open 'file.pgp': No such file or directory The code works successfully fine for sometimes and sometimes it shows the above error.
Can anyone let me know what can be issue, that the same decryption code works fine for some runs, but decryption fails for some runs.
01 Answer
Did you change the directory to your file's directory?
If the file is in C:\Users\%USERNAME%\Desktop\, you need to run Set-Location -Path C:\Users\%USERNAME%\Desktop\ before decrypting your file.