Skip to content

Commit 0c30079

Browse files
committed
Remove 7Zip dependency
Replaced 7ZipforPowerShell dependency with windows tar.exe and reduced number of files being extracted to only the ones we require Signed-off-by: Brian O'Connell <brian.oconnell@broadcom.com>
1 parent e379e8f commit 0c30079

1 file changed

Lines changed: 4 additions & 9 deletions

File tree

VMware.CloudFoundation.InstanceRecovery.psm1

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -266,12 +266,6 @@ Function Confirm-VCFInstanceRecoveryPreReqs {
266266

267267
#Check Dependencies
268268
$jumpboxName = hostname
269-
$is7Zip4PowerShellInstalled = Get-InstalledModule -name "7Zip4PowerShell" -RequiredVersion "2.4.0" -ErrorAction SilentlyContinue
270-
If (!$is7Zip4PowerShellInstalled) {
271-
LogMessage -type WARNING -message "[$jumpboxName] 7Zip4PowerShell Module Missing. Please install"
272-
} else {
273-
LogMessage -type INFO -message "[$jumpboxName] 7Zip4PowerShell Module found"
274-
}
275269

276270
$isPoshSSHInstalled = Get-InstalledModule -name "Posh-SSH" -RequiredVersion "3.0.8" -ErrorAction SilentlyContinue
277271
If (!$isPoshSSHInstalled) {
@@ -373,10 +367,11 @@ Function New-ExtractDataFromSDDCBackup {
373367
$command = "openssl enc -d -aes-256-cbc -md sha256 -in $backupFileFullPath -pass pass:`"$encryptionPassword`" -out `"$parentFolder\decrypted-sddc-manager-backup.tar.gz`""
374368
Invoke-Expression "& $command" *>$null
375369

376-
#Extract Backup
370+
#Extract Required Files From Backup Leveraging Windows tar.exe
377371
LogMessage -type INFO -message "[$jumpboxName] Extracting Backup"
378-
Expand-7Zip -ArchiveFileName "$parentFolder\decrypted-sddc-manager-backup.tar.gz" -TargetPath $parentFolder
379-
Expand-7Zip -ArchiveFileName "$parentFolder\decrypted-sddc-manager-backup.tar" -TargetPath $parentFolder
372+
Set-Location "$parentFolder"
373+
tar -xzf "$parentFolder\decrypted-sddc-manager-backup.tar.gz" "$extractedBackupFolder/metadata.json" "$extractedBackupFolder/appliancemanager_dns_configuration.json" "$extractedBackupFolder/appliancemanager_ntp_configuration.json" "$extractedBackupFolder/security_password_vault.json" "$extractedBackupFolder/database/sddc-postgres.bkp"
374+
380375

381376
#Get Content of Password Vault
382377
LogMessage -type INFO -message "[$jumpboxName] Reading Password Vault"

0 commit comments

Comments
 (0)