add environment path to powershell

https://4sysops.com/archives/use-powershell-to-execute-an-exe/

https://stackoverflow.com/questions/714877/setting-windows-powershell-path-variable#

临时添加

If, some time during a PowerShell session, you need to modify the PATH environment variable temporarily, you can do it this way:

$env:Path += ";C:\Program Files\GnuWin32\bin"

每次启动powershell的时候,自动添加

Changing the actual environment variables can be done by using the env: namespace / driveinformation. For example, this code will update the path environment variable:

$env:Path = "SomeRandomPath";

There are ways to make environment settings permanent, but if you are only using them from PowerShell, it's probably a lot better to use your profile to initiate the settings. On startup, PowerShell will run any .ps1 files it finds in the WindowsPowerShell directory under My Documents folder. Typically you have a profile.ps1 file already there. The path on my computer is

c:\Users\JaredPar\Documents\WindowsPowerShell\profile.ps1

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值