PowerShell flexibility in scope of environment variables via scripts
问题 In bash, if I define a variable inside a script (say, set_var.sh ), I can choose whether those definitions persist after "running" the script. This will depend on how I "run" the script, the options being: sh set_var.sh (variables do not persist) ./set_var.sh (variables do not persist, same as point 1) source set_var.sh (variables persist) This is irrespective from the variable being exported to the environment or not in set_var.sh . Can the same as items 1 and 3 above be achieved with