veeam: Fix escape powershell comand when listing Veeam repository names (#6943)

PR #5774 introduced a functionality to allow operators to choose in which Veeam's repository, if more than one is configured, ACS' clone job will be executed. However, a change was missing in the PR and caused the errors reported in #6599.

This PR addresses the fix for #6599.

Co-authored-by: SadiJr <sadi@scclouds.com.br>
This commit is contained in:
SadiJr 2022-12-12 04:16:30 -03:00 committed by GitHub
parent 8aaa5edaa1
commit 19a4e9dd50
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -369,7 +369,7 @@ public class VeeamClient {
protected String getRepositoryNameFromJob(String backupName) { protected String getRepositoryNameFromJob(String backupName) {
final List<String> cmds = Arrays.asList( final List<String> cmds = Arrays.asList(
String.format("$Job = Get-VBRJob -name \"%s\"", backupName), String.format("$Job = Get-VBRJob -name \"%s\"", backupName),
"$Job.GetBackupTargetRepository() ^| select Name | Format-List" "$Job.GetBackupTargetRepository() ^| select Name ^| Format-List"
); );
Pair<Boolean, String> result = executePowerShellCommands(cmds); Pair<Boolean, String> result = executePowerShellCommands(cmds);
if (result == null || !result.first()) { if (result == null || !result.first()) {