Closed sofiangava closed 3 months ago
HI,
I'm trying to encrypt a file and I am getting WARNING: Protect-PGP - Can't encrypt file C:\local\Temp\export.csv: Exception calling "EncryptFile" with "2" argument(s): "No encryption methods specified"
I am calling it this way:
$keyFilePath = Join-Path $env:TEMP "public.asc" Set-Content -Path $keyFilePath -Value $env:gpgKey
$encryptedContent = Protect-PGP -FilePathPublic $keyFilePath -FilePath $localFilePathdownload
Would love some assistance to understand why this is failing :)
Sofia
Dunno, probably your public key has wrong format when you save it to temporary file. Try with different encoding
HI,
I'm trying to encrypt a file and I am getting WARNING: Protect-PGP - Can't encrypt file C:\local\Temp\export.csv: Exception calling "EncryptFile" with "2" argument(s): "No encryption methods specified"
I am calling it this way:
Write the key text to a temporary file
$keyFilePath = Join-Path $env:TEMP "public.asc" Set-Content -Path $keyFilePath -Value $env:gpgKey
Encrypt the CSV file
$encryptedContent = Protect-PGP -FilePathPublic $keyFilePath -FilePath $localFilePathdownload
Would love some assistance to understand why this is failing :)
Sofia