diff --git a/bitwardenBackup.ps1 b/bitwardenBackup.ps1 index 8bf1245..50f6a58 100644 --- a/bitwardenBackup.ps1 +++ b/bitwardenBackup.ps1 @@ -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 \ No newline at end of file +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 + } + } +} +#> \ No newline at end of file