Setting PATH through poweshell command line on windows server 2022 does not work

114 views Asked by At

On my windows server 2022, I have PATH environment variable set to

 $Env:Path
C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\ProgramData\chocolatey\bin;;C:\Users\Administrator\AppData\Local\Programs\Python\Python312-32\Scripts\;C:\Users\Administrator\AppData\Local\Programs\Python\Python312-32\;C:\Users\Administrator\AppData\Local\Programs\Python\Launcher\;C:\Users\Administrator\AppData\Local\Microsoft\WindowsApps;C:\Program Files\smartmontools\bin

Now I am trying to add another directory to the PATH on powershell. I tried set, setx commands and even [Environment]::SetEnvironmentVariable("Path", "C:\Program Files (x86)\Sourceforge\ipmiutil", "Machine") The command showed success, but the PATH env variable does not get updated. I am not sure my PATH has reached Max characters limit.

But I guess using [Environment]::SetEnvironmentVariable can get advantage of 32,767 characters for an environmental variable. Although even with that the PATH is not getting updated at all. I need to do it through command line. How can I set PATH to the new ipmiutil, I downloaded.

Thank you

0

There are 0 answers