added exit at the bottom and --no-options for gpg

This commit is contained in:
2021-11-25 11:56:07 -05:00
parent 86e16e64ee
commit 9e64f093ac

View File

@@ -139,7 +139,7 @@ if ($zip -or $encrypt) {
if ($encrypt) {
# encrypt the zip export with gpg
Write-Host "Encrypting the backup zip with your bitwarden password..."
& $gpg --batch --passphrase "$password" --symmetric --cipher-algo AES256 --digest-algo SHA512 --compression-algo Uncompressed --output "$PSScriptRoot\$zipFilename.gpg" "$PSScriptRoot\$zipFilename"
& $gpg --no-options --batch --passphrase "$password" --symmetric --cipher-algo AES256 --digest-algo SHA512 --compression-algo Uncompressed --output "$PSScriptRoot\$zipFilename.gpg" "$PSScriptRoot\$zipFilename"
# securely delete the zip export with sdelete
Write-Host "Securely deleting the zip file..."
& $sdelete -p 25 "$PSScriptRoot\$zipFilename"
@@ -148,4 +148,5 @@ if ($zip -or $encrypt) {
# remove all the variables
Remove-Variable -Name * -ErrorAction SilentlyContinue
# logout of bitwaren to ensure the session is destroyed
& $bw logout
& $bw logout
exit 0