added quick notes for restoring attachments
This commit is contained in:
@@ -148,4 +148,31 @@ if ($zip -or $encrypt) {
|
||||
# logout of bitwaren to ensure the session is destroyed
|
||||
& $bw logout
|
||||
# remove all the variables
|
||||
Remove-Variable -Name * -ErrorAction SilentlyContinue
|
||||
Remove-Variable -Name * -ErrorAction SilentlyContinue
|
||||
|
||||
|
||||
|
||||
<#
|
||||
|
||||
# Restore of attachements
|
||||
|
||||
cd C:\users\jgaunt\Git\bitwardenbackup\attachments
|
||||
|
||||
bw status
|
||||
|
||||
$folders = Get-childItem -Directory
|
||||
$items = bw list items | convertfrom-json
|
||||
$array = @()
|
||||
foreach ($folder in $folders) {
|
||||
foreach ($item in $items) {
|
||||
if ($folder.name -eq $item.name -and $item.type -gt 1) {
|
||||
#$array += bw get item $item.id | convertfrom-json
|
||||
$attachements = Get-ChildItem $folder
|
||||
foreach ($attachement in $attachements) {
|
||||
bw create attachment --file "$($attachement.FullName)" --itemid $item.id
|
||||
}
|
||||
Remove-Item -Recurse $folder
|
||||
}
|
||||
}
|
||||
}
|
||||
#>
|
||||
Reference in New Issue
Block a user