Upload New File
This commit is contained in:
25
portwarden_commands.ps1
Normal file
25
portwarden_commands.ps1
Normal file
@@ -0,0 +1,25 @@
|
||||
# get the date/time for the back filename
|
||||
$dateTime = get-date -format ("yyyyMMdd-HHmmss")
|
||||
$directory = "$env:Temp\Bitwarden"
|
||||
$filename = "Bitwarden Backup $dateTime"
|
||||
|
||||
$env:Path += ";$PSScriptRoot;PSScriptRoot\gpg\bin"
|
||||
|
||||
# update server for BW CLI
|
||||
bw.exe config server https://bitwarden.johnhgaunt.com
|
||||
|
||||
# create the backup directory
|
||||
New-Item -ItemType directory -Force -Path "$directory" | out-null
|
||||
|
||||
# backup bitwarden
|
||||
portwarden_windows_amd64.exe --passphrase "34865y34iugb2ut4n^UHG%TBR" --filename "$directory\$filename.portwarden" encrypt
|
||||
portwarden_windows_amd64.exe --passphrase "34865y34iugb2ut4n^UHG%TBR" --filename "$directory\$filename.portwarden" decrypt
|
||||
|
||||
#
|
||||
rename-item "$directory\$filename.portwarden.decrypted.zip" "$directory\$filename.zip"
|
||||
|
||||
# gpg encrypt while asking for the password
|
||||
gpg.exe --symmetric --cipher-algo AES256 --digest-algo SHA512 --output "$PSScriptRoot\$filename.zip.gpg" "$directory\$filename.zip"
|
||||
|
||||
# delete files and wipe item
|
||||
sdelete64.exe -nobanner -s -p 10 "$directory"
|
||||
Reference in New Issue
Block a user