Skip to content

Commit

Permalink
Introduced a force logout execution flag.
Browse files Browse the repository at this point in the history
  • Loading branch information
trparky committed Mar 7, 2024
1 parent 1b97b62 commit f93716d
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Export-Bitwarden.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
RootModule = 'Export-Bitwarden.psm1'

# Version number of this module.
ModuleVersion = '1.40'
ModuleVersion = '1.41'

# Supported PSEditions
# CompatiblePSEditions = @()
Expand Down
18 changes: 16 additions & 2 deletions Export-Bitwarden.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@

function Export-Bitwarden { # Don't touch this line!
param (
[switch]$forcebwcliupdate
[switch]$forcebwcliupdate,
[switch]$forcelogpout
)

# This tells the script if it should automatically check for an update of the Bitwarden CLI executable that's actually responsible for backing up your Bitwarden vault.
Expand All @@ -31,7 +32,7 @@ function Export-Bitwarden { # Don't touch this line!
# == WARNING!!! DO NOT TOUCH ANYTHING BELOW THIS!!! ==
# ====================================================

$ver = "1.40"
$ver = "1.41"

Write-Host -ForegroundColor Green "========================================================================================"
Write-Host -ForegroundColor Green "== Bitwarden Vault Export Script v$ver =="
Expand Down Expand Up @@ -194,6 +195,19 @@ function Export-Bitwarden { # Don't touch this line!
Write-Host ""
}

if ($forcelogpout) {
LockAndLogout
Write-Host "Exiting script."
$env:BW_SESSION = ""
$bwPasswordEncrypted = ""
$bwPasswordPlainText = ""
$password1Encrypted = ""
$password1PlainText = ""
$password2Encrypted = ""
$password2PlainText = ""
return
}

# Prompt user for their Bitwarden username
$userEmail = Read-Host "Enter your Bitwarden Username"

Expand Down

0 comments on commit f93716d

Please sign in to comment.