在powershell中常规的设置环境变量,如下就可以满足需要了
//New or Modify $env:test = 12 //Read $env:test //delete del env:test //list dir env:
但是,以上的的设置只能在当前回话中起作用,如果我们想在下次启动使依然有效就需要指定用户,入给user,如下
//new or modify [Environment]::SetEnvironmentVariable("test","success","User") //Rad [Envrionment]::GetEnvironmentVariable("test","User") //delete del env:test
这样 就能解决环境变量设置后,下次操作不能使用的问题了。。
以上个人理解,个人理解,欢迎指正!!