From 0e1d0d5eb433eb81d19d02f7d5322bbb04cc17e9 Mon Sep 17 00:00:00 2001 From: John Gaunt Date: Wed, 24 Nov 2021 10:59:26 -0500 Subject: [PATCH] added logic for gpg and zip --- backupBitwarden.ps1 | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/backupBitwarden.ps1 b/backupBitwarden.ps1 index d0d88f5..e661987 100644 --- a/backupBitwarden.ps1 +++ b/backupBitwarden.ps1 @@ -1,8 +1,14 @@ param ( - [Parameter(ParameterSetName='One',Mandatory=$true)][switch]$zip, - [Parameter(ParameterSetName='One')][switch]$gpg + [switch]$zip, + [switch]$gpg ) +# the validatescript for the param was not working when -gpg -zip was passed in so this will be the fucntion +if ($gpg -and -not $zip) { + Write-Error "You cannot use -gpg without -zip." + exit 1 +} + # get the date/time for the back filename $dateTime = get-date -format ("yyyyMMdd-HHmmss") $env:Path += ";$PSScriptRoot\lib;$PSScriptRoot\lib\gpg\bin"