Last active
May 29, 2021 15:46
-
-
Save serban-petrescu/2fbe443506d94ac70cda4a237b9144a3 to your computer and use it in GitHub Desktop.
BW-AWS: Get creds
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Find-BWField() { | |
param ($item, $name) | |
[Array]::Find($item.fields, [Predicate[Object]] { $args[0].name -eq $name }).value | |
} | |
$item = bw get item $id | ConvertFrom-Json | |
$account = Find-BWField -item $item -name "ACCOUNT" | |
$keyId = Find-BWField -item $item -name "ACCESS_KEY_ID" | |
$secretKey = Find-BWField -item $item -name "SECRET_ACCESS_KEY" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment