Am trying to install multiple softwares and some of them are dependent on others, means it looks up for some binary of softwares before install others. This installation process am doing it on Powershell and when the first software installation completed it will append the path location on Path environment variable. But its not showing the updated Path env variable for the current active session and due to that other softwares are getting failed to install.
Before install that software:
PS C:\Users\webapp> $env:Path
C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\ProgramFiles\Pragma\Clients
After install the software:
PS C:\Users\webapp> $env:Path
C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\ProgramFiles\Pragma\Clients
But it suppose to show:
PS C:\Users\webapp> $env:Path
C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\ProgramFiles\Pragma\Clients;C:\apps-core\bin
I was able to update the Path env variable for the active command prompt session using below metho
for /f "tokens=3*" %%A in ('reg query "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment" /v Path') do set syspath=%%A%%B
set Path=%syspath%
but am not sure how can I achieve the same with Powershell.