gpt4 book ai didi

windows - 设置 Windows PowerShell 环境变量

转载 作者:可可西里 更新时间:2023-11-01 11:50:44 27 4
gpt4 key购买 nike

我发现设置 PATH 环境变量只会影响旧的命令提示符。 PowerShell 似乎有不同的环境设置。如何更改 PowerShell (v1) 的环境变量?

注意:

我想让我的更改永久生效,这样我就不必在每次运行 PowerShell 时都进行设置。 PowerShell 是否有配置文件?类似于 Unix 上的 Bash 配置文件?

最佳答案

如果在 PowerShell session 期间的某个时间,您需要查看或临时修改 PATH 环境变量,您可以键入以下命令之一:

$env:Path                             # shows the actual content
$env:Path = 'C:\foo;' + $env:Path # attach to the beginning
$env:Path += ';C:\foo' # attach to the end

关于windows - 设置 Windows PowerShell 环境变量,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/714877/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com