I have looked at VSCode settings, I can't see clearly what "integrated" means that's what I have but it loads external powershell profile. I want to prevent it to do so, is it possible ?
P.S. : I don't have and don't want powershell extensions, should I to have this option ?
Update: As suggested I have unchecked "powershell.enableProfileLoading" both in User and Workspace settings, relaunched vscode, but in terminal still gets "Loading personal and system profiles took" weirdly it still doesn't work for me ?
Is it possible this is a VSCode settings bug ?
CodePudding user response:
If you DO have Visual Studio Code's PowerShell extension installed and you want to suppress loading of profiles in its special-purpose shell, the PowerShell Integrated Console (PIC):
GUI option: Via the Settings dialog, uncheck the option
PowerShell: Enable Profile LoadingSettings.jsonfile option: As Santiago Squarzon states, add the following setting:"powershell.enableProfileLoading": false
If you do NOT have the PowerShell extension installed OR you (also) want to control profile loading for general-purpose PowerShell sessions running in Visual Studio's integrated terminal:
In the Settings dialog, search for
terminal profilesand click on theEdit in settings.jsonlink next to the platform-appropriateTerminal › Integrated › Profiles: <os>entry, where<os>is one ofwindows,linuxorosx(macOS).This will open your
Settings.jsonfile for editing and either create or navigate to a preexisting"terminal.integrated.profiles.<os>"object, which contains the profiles of all shells available in the integrated terminal.Locate the PowerShell profile and add an
"args": [ "-noprofile" ]property in order to suppress profile loading, which passes the-noprofileparameter to the PowerShell CLI (powershell.exefor Windows PowerShell,pwshfor PowerShell (Core) 7 ) on startup; e.g., on Windows:
"terminal.integrated.profiles.windows": {
"PowerShell": {
"source": "PowerShell",
"icon": "terminal-powershell",
"args": [ "-noprofile" ]
},
// ...
}
