Created
September 3, 2019 10:52
-
-
Save an-dr/80ce3e621b1c52cdbb31aef38b83c93a to your computer and use it in GitHub Desktop.
PS1 Script for setup a working environment
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function _expand ($r_path) { return [IO.Path]::GetFullPath($r_path) } | |
function _path_append ($path) { | |
$p = expand($path) ; $env:Path += ";" + $p | |
Write-Output ('PATH' + " = " + $path + ' + $PATH') | |
} | |
function _path_add ($path) { | |
$p = expand($path); $env:Path += $p + ";" + $env:Path | |
Write-Output ('PATH' + " += " + $path) | |
} | |
function _set ($name_val_pair) { | |
$e_val = _expand($name_val_pair[1]) | |
[Environment]::SetEnvironmentVariable($name_val_pair[0], $e_val, "Process") | Out-Null | |
Write-Output ($name_val_pair[0] + " = " + $e_val) | |
} | |
$SLASH = "C:" | |
# ================ Job ================ | |
# _path_append ".\esp-idr" | |
_set("APP_PATH", "./the_app") | |
_path_add("$SLASH/bin") | |
_path_append("$HOME/user_bin") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment