EvotecIT / PSPGP

PSPGP is a PowerShell module that provides PGP functionality in PowerShell. It allows encrypting and decrypting files/folders and strings using PGP.
MIT License
57 stars 21 forks source link

Unprotect-PGP from smb share fails #12

Closed johnnyjosefsson closed 10 months ago

johnnyjosefsson commented 1 year ago

Environment

It seems that performing Unprotect-PGP on a file directly over an windows file/smb share/UNC path files. But if the file is placed locally its possible to output it directly to a windows file/smb share/UNC path.

Unprotect-PGP -FilePathPrivate "C:\FILES\scripts\unprotect\gpg__privkey.asc" -Password "" -FilePath "\\domain.tld\shares\automatic\encrypted\2022-11-03.csv.pgp" -OutFilePath "\\domain.tld\shares\automatic\2022-11-03.csv.pgp" results in

WARNING: Unprotect-PGP - Remove PGP encryption from \domain.tld\shares\automatic\encrypted\2022-11-03.csv.pgp failed: Exception calling "DecryptFile" with "4" argument(s): "Encrypted File [Microsoft.PowerShell.Core\FileSystem::\domain.tld\shares\automatic\encrypted\2022-11-03.csv.pgp] not found."

But this works fine Unprotect-PGP -FilePathPrivate "C:\FILES\scripts\unprotect\gpg__privkey.asc" -Password "" -FilePath "C:\FILES\temp\unprotect\2022-11-03.csv.pgp" -OutFilePath "\\domain.tld\shares\automatic\2022-11-03.csv.pgp"