updated .gitignore, fixed typo, moved attachments to folder
This commit is contained in:
4
.gitignore
vendored
4
.gitignore
vendored
@@ -2,4 +2,6 @@
|
||||
*.gpg
|
||||
*.asc
|
||||
*.pgp
|
||||
|
||||
*.csv
|
||||
*.json
|
||||
attachments/
|
||||
@@ -23,7 +23,7 @@ Write-Verbose "Exporting vault to JSON."
|
||||
bw export $password --output "$PSScriptRoot\Bitwarden User $username Export $dateTime.json" --format json --session $sessionKey
|
||||
|
||||
Write-Host "Looking for Organizations..."
|
||||
$organizations = $(convertfrom-json $(bw list organizations --session $sessionKey))
|
||||
$organizations = $(ConvertFrom-Json $(bw list organizations --session $sessionKey))
|
||||
Write-Host "Found $(($organizations | measure).count) Organiztaions."
|
||||
|
||||
$organizations | foreach {
|
||||
@@ -35,12 +35,12 @@ $organizations | foreach {
|
||||
}
|
||||
|
||||
Write-Host "Looking for items with attachments..."
|
||||
$itemsWithAttachments = $((ConverFrom-Json $(bw list items --session $sessionKey)) | Where-Object attachments)
|
||||
$itemsWithAttachments = $((ConvertFrom-Json $(bw list items --session $sessionKey)) | Where-Object attachments)
|
||||
Write-Host "Found $(($itemsWithAttachments | measure).count) items with attachments."
|
||||
Write-Host "Downloading attachments..."
|
||||
$itemsWithAttachments | foreach {
|
||||
Write-Verbose "Working on item $($_.name) ($($_.id))."
|
||||
$folder="$PSScriptRoot\$($_.name)"
|
||||
$folder="$PSScriptRoot\attachments\$($_.name)"
|
||||
$itemID=$_.id
|
||||
$_.attachments | foreach {
|
||||
Write-Verbose "Downloading attachment ($($_.id)) with name $($_.fileName) to $folder."
|
||||
@@ -50,4 +50,4 @@ $itemsWithAttachments | foreach {
|
||||
}
|
||||
|
||||
Remove-Variable -Name * -ErrorAction SilentlyContinue
|
||||
pause
|
||||
bw logout
|
||||
Reference in New Issue
Block a user