我已经看了VSCODE设置,我看不到“集成”的意思是我所拥有的,但它加载了外部PowerShell配置文件。我想防止它这样做,这可能吗?
PS:我没有,也不想要PowerShell扩展,我应该有这个选择吗?
更新:正如建议的那样,我在用户和工作区设置中都没有选中“ powershell.enable ProfofileLeLoing”,重新启动的VScode,但是在终端中仍然可以“加载”个人和系统配置文件。
这可能是VSCODE设置错误吗?
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 ?
发布评论
评论(1)
如果您确实有Visual Studio Code的,您想抑制配置文件的特殊用途外壳中的加载, powershell Integrated Console (pic)::
GUI选项:通过设置对话框, unable 选项
powerShell:enable配置文件加载
settings.json
文件选项:AS santiago-squarzon> santiago squarzon 添加以下设置:“ PowerShell.enable ProfileLeLoading”:false
如果您没有安装PowerShell扩展名,或者您(也)想要控制通用POWERPOSE PowerShell的配置文件加载会议在Visual Studio的集成终端中运行:
在“设置”对话框中,搜索
终端配置文件
,然后单击在settings.json
link link platform-apprepprepprepprepprepprepprepprep终端›集成›配置文件:< os>
条目,其中< os>
是Windows
,linux
之一OSX (MacOS)。这将打开您的
settings.json
用于编辑的文件,然后创建或导航到preexisting“ terminal.intinal.integrated.integrated.profiles。对象,其中包含集成终端中所有可用外壳的轮廓。
找到powerShell配置文件并添加
“ args”:[“ -noprofile”]
属性,以抑制配置文件加载,该配置文件通过-noperofile
>参数到PowerShell CLI( 对于Windows PowerShell,pwsh
for PowerShell(core)7+)在启动时;例如,在 Windows 上: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 Loading
Settings.json
file 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 profiles
and click on theEdit in settings.json
link next to the platform-appropriateTerminal › Integrated › Profiles: <os>
entry, where<os>
is one ofwindows
,linux
orosx
(macOS).This will open your
Settings.json
file 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-noprofile
parameter to the PowerShell CLI (powershell.exe
for Windows PowerShell,pwsh
for PowerShell (Core) 7+) on startup; e.g., on Windows: