removed gpg from path, added logic for no 2fa
This commit is contained in:
@@ -1,15 +1,19 @@
|
||||
# get the date/time for the back filename
|
||||
$dateTime = get-date -format ("yyyyMMdd-HHmmss")
|
||||
$env:Path += ";$PSScriptRoot\lib;$PSScriptRoot\lib\gpg\bin"
|
||||
$env:Path += ";$PSScriptRoot\lib"
|
||||
|
||||
|
||||
bw config server https://bitwarden.johnhgaunt.com
|
||||
if ($sessionKey -eq $null) {
|
||||
$username = "jgaunt@johnhgaunt.com"
|
||||
$password = Read-Host -assecurestring "Please enter your bitwarden password: "
|
||||
$username = Read-Host "Please enter your bitwarden email"
|
||||
$password = Read-Host -assecurestring "Please enter your bitwarden password"
|
||||
$password = [System.Runtime.InteropServices.Marshal]::PtrToStringAuto([System.Runtime.InteropServices.Marshal]::SecureStringToBSTR($password))
|
||||
$code = Read-Host "Please enter your 2fa code: "
|
||||
$sessionKey = $(bw login $username $password --method 0 --code $code --raw)
|
||||
$code = Read-Host "Please enter your 2fa code (hit enter if not used)"
|
||||
if ($code -eq "") {
|
||||
$sessionKey = $(bw login $username $password --raw)
|
||||
} else {
|
||||
$sessionKey = $(bw login $username $password --method 0 --code $code --raw)
|
||||
}
|
||||
}
|
||||
|
||||
#convertfrom-json $(bw list organizations --session $sessionKey)
|
||||
|
||||
Reference in New Issue
Block a user