Skip to content

Commit 48cc8a8

Browse files
fix powershell profile source (microsoft#120138)
* fix PowerShell profile source * profile -> path
1 parent 0cea28a commit 48cc8a8

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

src/vs/workbench/contrib/terminal/node/terminalProfiles.ts

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -140,18 +140,20 @@ async function initializeWindowsProfiles(): Promise<void> {
140140
],
141141
args: ['--login']
142142
});
143-
for (const profile of await getPowershellProfiles()) {
144-
profileSources.set(profile.profileName, { profileName: profile.profileName, paths: profile.paths, args: profile.args });
145-
}
143+
144+
profileSources.set('PowerShell', {
145+
profileName: 'PowerShell',
146+
paths: await getPowershellPaths()
147+
});
146148
}
147149

148-
async function getPowershellProfiles(): Promise<IPotentialTerminalProfile[]> {
149-
const profiles: IPotentialTerminalProfile[] = [];
150+
async function getPowershellPaths(): Promise<string[]> {
151+
const paths: string[] = [];
150152
// Add all of the different kinds of PowerShells
151153
for await (const pwshExe of enumeratePowerShellInstallations()) {
152-
profiles.push({ profileName: pwshExe.displayName, paths: [pwshExe.exePath] });
154+
paths.push(pwshExe.exePath);
153155
}
154-
return profiles;
156+
return paths;
155157
}
156158

157159
async function getWslProfiles(wslPath: string, useWslProfiles?: boolean): Promise<ITerminalProfile[]> {

0 commit comments

Comments
 (0)