Skip to content

Instantly share code, notes, and snippets.

@serban-petrescu
Last active May 29, 2021 16:21
Show Gist options
  • Save serban-petrescu/25b1f2b7f973e1a9525e556f0fa9c894 to your computer and use it in GitHub Desktop.
Save serban-petrescu/25b1f2b7f973e1a9525e556f0fa9c894 to your computer and use it in GitHub Desktop.
BW-AWS: Unlock
function Unlock-Bw() {
$status = bw status | ConvertFrom-Json
if ($status.status -eq "locked") {
$password = (Get-Credential "Bitwarden").GetNetworkCredential().Password
$session = bw unlock $password --raw
$env:BW_SESSION = $session
}
}
# and later on, to wipe the session
$env:BW_SESSION = ""
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment