added review comments

This commit is contained in:
Akshaya M
2020-03-24 15:40:30 +05:30
parent 97c66dece8
commit 6df92eb730
2 changed files with 16 additions and 7 deletions

View File

@@ -59,9 +59,9 @@ class ServicePrincipalLogin {
const script = new ScriptBuilder_1.default().getAzPSLoginScript(ServicePrincipalLogin.scheme, this.tenantId, args);
yield PowerShellToolRunner_1.default.init();
yield PowerShellToolRunner_1.default.executePowerShellScriptBlock(script, options);
const outputJson = JSON.parse(output.trim());
if (!(Constants_1.default.Success in outputJson)) {
throw new Error(`Azure PowerShell login failed with error: ${outputJson[Constants_1.default.Error]}`);
const result = JSON.parse(output.trim());
if (!(Constants_1.default.Success in result)) {
throw new Error(`Azure PowerShell login failed with error: ${result[Constants_1.default.Error]}`);
}
});
}