From 93bf5cc2dd89ea98f70c1f85a8a32989e4e635af Mon Sep 17 00:00:00 2001 From: Kartik Raj Date: Thu, 26 Oct 2023 18:41:06 -0700 Subject: [PATCH] Handle localized shells when powershell execution is disabled (#22360) Closes https://github.com/microsoft/vscode-python/issues/22352 --- src/client/interpreter/activation/service.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/client/interpreter/activation/service.ts b/src/client/interpreter/activation/service.ts index 5fda5a9380dc..f97545a5823a 100644 --- a/src/client/interpreter/activation/service.ts +++ b/src/client/interpreter/activation/service.ts @@ -330,7 +330,10 @@ export class EnvironmentActivationService implements IEnvironmentActivationServi if (result.stderr) { if (returnedEnv) { traceWarn('Got env variables but with errors', result.stderr, returnedEnv); - if (result.stderr.includes('running scripts is disabled')) { + if ( + result.stderr.includes('running scripts is disabled') || + result.stderr.includes('FullyQualifiedErrorId : UnauthorizedAccess') + ) { throw new Error( `Skipping returned result when powershell execution is disabled, stderr ${result.stderr} for ${command}`, );