added id of item and attachment ids in parentheses

This commit is contained in:
2021-11-23 15:20:14 -05:00
parent 7ac97fabff
commit 480d3d9a1a

View File

@@ -40,12 +40,13 @@ $itemsWithAttachments = $((ConverFro-Json $(bw list items --session $sessionKey)
Write-Host "Found $(($itemsWithAttachments | measure).count) items with attachments."
Write-Host "Downloading attachments..."
$itemsWithAttachments | foreach {
Write-Verbose "Working on item $($_.name)."
Write-Verbose "Working on item $($_.name) ($($_.id))."
$folder="$PSScriptRoot\$($_.name)"
$itemID=$_.id
$_.attachments | foreach {
Write-Verbose "Downloading attachment $($_.id) with name $($_.fileName) to $folder."
Write-Verbose "Downloading attachment ($($_.id)) with name $($_.fileName) to $folder."
bw get attachment $_.id --itemid $itemID --output "$folder\$($_.fileName)" --session $sessionKey
sleep -Milliseconds 500
}
}
}