1

According to Setting Windows PowerShell environment variables it is possible to modify environment path in Powershell with

$env:Path = "C:\jdk-16.0.1\bin" + ';' + $env:Path

I tried (with admin rights) and checked $env:Path : it's ok

But if I close and reopen powershell, it's gone so did I miss something ?

2
  • 3
    Use [Environment]::SetEnvironmentVariable() to persist env vars, as detailed by this answer. Commented May 28, 2022 at 18:02
  • 2
    Alternatively, if you want to set an environment variable only for PowerShell, but not all other processes, add $env:Path = ... to your $Profile file. See stackoverflow.com/a/714918/7571258 Commented May 28, 2022 at 18:05

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.