From e6e4110c5a3891a8902fa4497ab99e66aaa5a160 Mon Sep 17 00:00:00 2001 From: John Gaunt Date: Tue, 23 Nov 2021 15:01:36 -0500 Subject: [PATCH] moved the output to the script directory. added 500ms sleep after the attachment get --- backupBitwarden.ps1 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/backupBitwarden.ps1 b/backupBitwarden.ps1 index 902acb0..8f5e029 100644 --- a/backupBitwarden.ps1 +++ b/backupBitwarden.ps1 @@ -18,13 +18,13 @@ if ($sessionKey -eq $null) { #convertfrom-json $(bw list organizations --session $sessionKey) -bw export $password --output "C:\users\jgaunt\3D Objects\Bitwarden User $username Export $dateTime.csv" --format csv --session $sessionKey -bw export $password --output "C:\users\jgaunt\3D Objects\Bitwarden User $username Export $dateTime.json" --format json --session $sessionKey +bw export $password --output "$PSScriptRoot\Bitwarden User $username Export $dateTime.csv" --format csv --session $sessionKey +bw export $password --output "$PSScriptRoot\Bitwarden User $username Export $dateTime.json" --format json --session $sessionKey $organizations = $(convertfrom-json $(bw list organizations)) # I shouldn't need portwarden anymore since I will just use bw and loop through the items with attachments # (convertfrom-json $(bw list items)) | where attachments -# $itemsWithAttachments | % { $folder=$_.name; $itemID=$_.id; $_.attachments | % { bw get attachment $_.id --itemid $itemID --output "C:\Users\jgaunt\3D Objects\Bitwarden\$folder\$_.fileName" } } +# $itemsWithAttachments | % { $folder=$_.name; $itemID=$_.id; $_.attachments | % { bw get attachment $_.id --itemid $itemID --output "C:\Users\jgaunt\3D Objects\Bitwarden\$folder\$_.fileName"; sleep -Milliseconds 500 } } # bw get attachment $attachmentID --itemid $itemID --output $file \ No newline at end of file