Skip to content

Commit 1c9bfa5

Browse files
committed
changes in loginAzurePowerShell
1 parent f805ead commit 1c9bfa5

2 files changed

Lines changed: 11 additions & 2 deletions

File tree

lib/loginAzurePowerShell.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,11 @@ function loginToAzure(servicePrincipalId, servicePrincipalKey, tenantId, subscri
8181
}
8282
function executePowerShellCommand(command, options = {}) {
8383
return __awaiter(this, void 0, void 0, function* () {
84-
yield exec.exec(`"${psPath}" -Command "${command}"`, [], options);
84+
try {
85+
yield exec.exec(`"${psPath}" -Command "${command}"`, [], options);
86+
}
87+
catch (error) {
88+
throw new Error(error);
89+
}
8590
});
8691
}

src/loginAzurePowerShell.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,5 +64,9 @@ async function loginToAzure(servicePrincipalId: string, servicePrincipalKey: str
6464
}
6565

6666
async function executePowerShellCommand(command: string, options: any = {}) {
67-
await exec.exec(`"${psPath}" -Command "${command}"`, [], options);
67+
try {
68+
await exec.exec(`"${psPath}" -Command "${command}"`, [], options);
69+
} catch (error) {
70+
throw new Error(error);
71+
}
6872
}

0 commit comments

Comments
 (0)