In my script, when I do
$env:Path = "Some Path"
and I execute my script within the ISE, $env:Path for the ISE session is now set to "Some Path". I would like to modify the $env:Path for the script only, making it revert back to the original value in the ISE session,after the execution of the script. Right now, I have to close and restart the ISE.
The idea is to change the environment for the scope of my script only. If there is a better idiom in Powershell, please let me know.