1 Star 0 Fork 0

超哥 / templating

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
SetPath.ps1 558 Bytes
一键复制 编辑 原始数据 按行查看 历史
param(
[switch]$ComputeOnly=$false,
[string]$DevDir)
$NewPath = $DevDir + ";" + (($env:PATH.Split(';') | select -unique | where {-not $_.StartsWith($PSScriptRoot)}) -join ";")
if (!$ComputeOnly) {
[Environment]::SetEnvironmentVariable("Path", "$NewPath", [System.EnvironmentVariableTarget]::User)
$env:Path = $NewPath
}
else {
$x = [string]::Concat('SET "PATH=', $NewPath, '"')
$Utf8NoBomEncoding = New-Object System.Text.UTF8Encoding $False
[System.IO.File]::WriteAllLines("$PSScriptRoot\artifacts\NewPath.bat", $x, $Utf8NoBomEncoding)
}
1
https://gitee.com/yhc2020/templating.git
git@gitee.com:yhc2020/templating.git
yhc2020
templating
templating
rel/2.1.0-preview2

搜索帮助