Skip to content

Commit d4f2164

Browse files
Fix small bug with powerShellDefaultVersion warning (#4297)
Missed a conditional.
1 parent 11c7f3a commit d4f2164

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/session.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -504,7 +504,7 @@ export class SessionManager implements Middleware {
504504

505505
}
506506
foundPowerShell = defaultPowerShell ?? await powershellExeFinder.getFirstAvailablePowerShellInstallation();
507-
if (defaultPowerShell === undefined && foundPowerShell !== undefined) {
507+
if (wantedName !== "" && defaultPowerShell === undefined && foundPowerShell !== undefined) {
508508
void this.logger.writeAndShowWarning(`The 'powerShellDefaultVersion' setting was '${wantedName}' but this was not found!`
509509
+ ` Instead using first available installation '${foundPowerShell.displayName}' at '${foundPowerShell.exePath}'!`);
510510
}

0 commit comments

Comments
 (0)