Last active
December 14, 2024 06:48
-
-
Save CN-CODEGOD/a42458ba755bec66f64a26e5e8e1640a to your computer and use it in GitHub Desktop.
Powershell添加系统环境变量
This file contains hidden or 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
| #获取环境变量 | |
| $pspath=[System.Environment]::GetEnvironmentVariable('psModulepath','machine') | |
| #添加环境变量 | |
| $pspath+=";$home\modules" | |
| #设置环境变量 | |
| [System.Environment]::SetEnvironmentVariable('psmodulepath',$pspath,'machine') | |
| #系统环境变量和用户环境变量的区别 | |
| 系统环境变量: 'machine' | |
| 当前用户环境变量:'User' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment