如何防止VSCODE加载PowerShell配置文件?

发布于 2025-02-02 12:23:30 字数 251 浏览 1 评论 0 原文

我已经看了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 ?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

凉宸 2025-02-09 12:23:30
"terminal.integrated.profiles.windows": {
        "PowerShell": {
            "source": "PowerShell",
            "icon": "terminal-powershell",
            "args": [ "-noprofile" ]
        },
        // ...
}
  • 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 the Edit in settings.json link next to the platform-appropriate Terminal › Integrated › Profiles: <os> entry, where <os> is one of windows, linux or osx (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:

"terminal.integrated.profiles.windows": {
        "PowerShell": {
            "source": "PowerShell",
            "icon": "terminal-powershell",
            "args": [ "-noprofile" ]
        },
        // ...
}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文