如何以默认设置为noprofile选项始终启动powershell.exe?
我需要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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论