From 6a323fefc7b1ee2452aa82f34e222fe2f57d590a Mon Sep 17 00:00:00 2001 From: Andy Jordan Date: Thu, 1 Dec 2022 13:01:42 -0800 Subject: [PATCH] Fix small bug with `powerShellDefaultVersion` warning Missed a conditional. --- src/session.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/session.ts b/src/session.ts index ee778ac530..4927e5f08a 100644 --- a/src/session.ts +++ b/src/session.ts @@ -504,7 +504,7 @@ export class SessionManager implements Middleware { } foundPowerShell = defaultPowerShell ?? await powershellExeFinder.getFirstAvailablePowerShellInstallation(); - if (defaultPowerShell === undefined && foundPowerShell !== undefined) { + if (wantedName !== "" && defaultPowerShell === undefined && foundPowerShell !== undefined) { void this.logger.writeAndShowWarning(`The 'powerShellDefaultVersion' setting was '${wantedName}' but this was not found!` + ` Instead using first available installation '${foundPowerShell.displayName}' at '${foundPowerShell.exePath}'!`); }