login commented

This commit is contained in:
Balaga Gayatri 2021-09-06 15:22:14 +05:30
commit f2f62940c6
2 changed files with 8 additions and 8 deletions

View file

@ -77,10 +77,10 @@ class ServicePrincipalLogin {
const script = new ScriptBuilder_1.default().getAzPSLoginScript(ServicePrincipalLogin.scheme, this.tenantId, args);
yield PowerShellToolRunner_1.default.init();
// await PowerShellToolRunner.executePowerShellScriptBlock(script, options);
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]}`);
}
// const result: any = JSON.parse(output.trim());
// if (!(Constants.Success in result)) {
// throw new Error(`Azure PowerShell login failed with error: ${result[Constants.Error]}`);
// }
console.log(`Azure PowerShell session successfully initialized`);
});
}

View file

@ -61,10 +61,10 @@ export class ServicePrincipalLogin implements IAzurePowerShellSession {
const script: string = new ScriptBuilder().getAzPSLoginScript(ServicePrincipalLogin.scheme, this.tenantId, args);
await PowerShellToolRunner.init();
// await PowerShellToolRunner.executePowerShellScriptBlock(script, options);
const result: any = JSON.parse(output.trim());
if (!(Constants.Success in result)) {
throw new Error(`Azure PowerShell login failed with error: ${result[Constants.Error]}`);
}
// const result: any = JSON.parse(output.trim());
// if (!(Constants.Success in result)) {
// throw new Error(`Azure PowerShell login failed with error: ${result[Constants.Error]}`);
// }
console.log(`Azure PowerShell session successfully initialized`);
}