added id of item and attachment ids in parentheses
This commit is contained in:
@@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user