如何以默认设置为noprofile选项始终启动powershell.exe?

发布于 2025-02-04 03:57:09 字数 533 浏览 4 评论 0原文

我需要powershell.exe始终使用-noprofile选项在我首次打开时设置。

如何实现?我搜索了很多,没有找到任何方法。

解决:我更改了Windows终端和VSCODE的JSON设置,以始终使用-noprofile选项启动PowerShell.exe。在WindowsTerminal:

"commandline": "%SystemRoot%\\System32\\WindowsPowerShell\\v1.0\\powershell.exe -noprofile"

obs :我想这样做,因为在任何环境中启动PowerShell(Vscode,Windows终端等)始终需要超过2秒钟。当我使用-noprofile选项运行可执行文件时,它会瞬间。有些人建议清空profile.ps1文件,但甚至不存在。

I need that powershell.exe always executes with the -noprofile option set when I first open it.

How can this be achieved? I searched a lot, and didn't find any way to do this.

work around: I changed Windows Terminal and VSCode's json settings to always start powershell.exe with the -noprofile option. In WindowsTerminal:

"commandline": "%SystemRoot%\\System32\\WindowsPowerShell\\v1.0\\powershell.exe -noprofile"

Obs: I want to do this because starting PowerShell in any environment (VSCode, Windows Terminal, etc) always takes more than 2 seconds. When I run the executable with the -NoProfile option, it instantaneous. Some have suggested to empty the profile.ps1 file, but it doesn't even exists.

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

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

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文