refactor and rename scripts

This commit is contained in:
Dibir Magomedsaygitov
2020-09-30 20:13:40 +03:00
parent 85b60d074c
commit 56633cec4a
7 changed files with 9 additions and 27 deletions

View File

@@ -4,19 +4,9 @@ $dotnetPath = "$env:USERPROFILE\.dotnet\tools"
if ($latestPath.Contains("C:\Users\VssAdministrator\.dotnet\tools"))
{
$latestPath = $latestPath.Replace("C:\Users\VssAdministrator\.dotnet\tools", "$dotnetPath")
$isPathUpdated = $true
}
if (-not $latestPath.Contains($dotnetPath))
{
$latestPath = "$dotnetPath;$latestPath"
Write-Host "Added .dotnet\tools $dotnetPath to PATH"
$isPathUpdated = $true
}
else
{
Write-Host "$dotnetPath already in PATH"
}
$updatedPath = [System.Environment]::GetEnvironmentVariable('PATH', [System.EnvironmentVariableTarget]::Machine)
Write-Host "Windows PATH: $updatedPath"
}

View File

@@ -0,0 +1,8 @@
$hgPath = "$Env:ProgramFiles\Mercurial\"
$latestPath = [System.Environment]::GetEnvironmentVariable('PATH', [System.EnvironmentVariableTarget]::Machine)
if (Test-Path -Path $hgPath)
{
$latestPath = "$hgPath;$latestPath"
Write-Host "Added Mercurial to PATH"
}

View File

@@ -1,16 +0,0 @@
$hgPath = "$Env:ProgramFiles\Mercurial\"
$latestPath = [System.Environment]::GetEnvironmentVariable('PATH', [System.EnvironmentVariableTarget]::Machine)
if (Test-Path -Path $hgPath)
{
$latestPath = "$hgPath;$latestPath"
Write-Host "Added Mercurial to PATH"
$isPathUpdated = $true
}
else
{
Write-Host "Didn't find Mercurial at $hgPath. Skipping adding PATH to it."
}
$updatedPath = [System.Environment]::GetEnvironmentVariable('PATH', [System.EnvironmentVariableTarget]::Machine)
Write-Host "Windows PATH: $updatedPath"