resolve comments

This commit is contained in:
Dibir Magomedsaygitov
2020-09-30 12:34:36 +03:00
parent 94c7463a7f
commit 85b60d074c
7 changed files with 30 additions and 65 deletions

View File

@@ -1,4 +1,4 @@
# Add well-known SSH host keys to ssh_known_hosts # Add well-known SSH host keys to ssh_known_hosts
ssh-keyscan -t rsa github.com >> "C:\Program Files\Git\etc\ssh\ssh_known_hosts" ssh-keyscan -t rsa github.com >> "C:\Program Files\Git\etc\ssh\ssh_known_hosts"
ssh-keyscan -t dsa github.com >> "C:\Program Files\Git\etc\ssh\ssh_known_hosts" ssh-keyscan -t rsa ssh.dev.azure.com >> "C:\Program Files\Git\etc\ssh\ssh_known_hosts"

View File

@@ -1,30 +0,0 @@
# Create Rust junction points to cargo and rustup folder
$cargoTarget = "$env:USERPROFILE\.cargo"
if (-not (Test-Path $cargoTarget))
{
New-Item -ItemType Junction -Path $cargoTarget -Target "C:\Rust\.cargo"
if (Test-Path $cargoTarget)
{
Write-Host "Junction created for $cargoTarget <<===>> C:\Rust\.cargo"
}
else
{
Write-Host "Junction was not created for $cargoTarget"
}
}
$rustupTarget = "$env:USERPROFILE\.rustup"
if (-not (Test-Path $rustupTarget))
{
New-Item -ItemType Junction -Path $rustupTarget -Target "C:\Rust\.rustup"
if (Test-Path $rustupTarget)
{
Write-Host "Junction created for $rustupTarget <<===>> C:\Rust\.rustup"
}
else
{
Write-Host "Junction was not created for $rustupTarget"
}
}

View File

@@ -0,0 +1,12 @@
# Create Rust junction points to cargo and rustup folder
$cargoTarget = "$env:USERPROFILE\.cargo"
if (-not (Test-Path $cargoTarget))
{
New-Item -ItemType Junction -Path $cargoTarget -Target "C:\Rust\.cargo"
}
$rustupTarget = "$env:USERPROFILE\.rustup"
if (-not (Test-Path $rustupTarget))
{
New-Item -ItemType Junction -Path $rustupTarget -Target "C:\Rust\.rustup"
}

View File

@@ -1,9 +1,7 @@
# Script to address any current issues with images that could be easily worked around.
$ErrorActionPreference="Stop" $ErrorActionPreference="Stop"
# Remove 3 registry settings that are left behind when sysprepping. Having those registry settings together with a # Remove 3 registry settings that are left behind when sysprepping. Having those registry settings together with a
# race condition that kicks in when trying to run custom scripts extensions and stops us from reimaging machines. # race condition that kicks in when trying to run custom scripts extensions and stops us from reimaging machines.
# ICM: https://portal.microsofticm.com/imp/v3/incidents/details/191973270/home
Remove-ItemProperty -Path 'Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows Azure\HandlerState' -Name 'Incarnation' -Force -ErrorAction Ignore Remove-ItemProperty -Path 'Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows Azure\HandlerState' -Name 'Incarnation' -Force -ErrorAction Ignore
Remove-ItemProperty -Path 'Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows Azure\HandlerState' -Name 'InVmSvdSeqNo' -Force -ErrorAction Ignore Remove-ItemProperty -Path 'Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows Azure\HandlerState' -Name 'InVmSvdSeqNo' -Force -ErrorAction Ignore
Remove-ItemProperty -Path 'Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows Azure\HandlerState' -Name 'LastGoalStateMethod' -Force -ErrorAction Ignore Remove-ItemProperty -Path 'Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows Azure\HandlerState' -Name 'LastGoalStateMethod' -Force -ErrorAction Ignore

View File

@@ -1,14 +0,0 @@
if ([string]::IsNullOrEmpty($env:RUNNER_TOOL_CACHE))
{
$env:RUNNER_TOOL_CACHE=$env:AGENT_TOOLSDIRECTORY
[System.Environment]::SetEnvironmentVariable('RUNNER_TOOL_CACHE', $env:AGENT_TOOLSDIRECTORY, [System.EnvironmentVariableTarget]::Machine)
Write-Host "RUNNER_TOOL_CACHE set to match AGENT_TOOLSDIRECTORY: $env:RUNNER_TOOL_CACHE"
[System.Environment]::SetEnvironmentVariable('AGENT_TOOLSDIRECTORY', $null, [System.EnvironmentVariableTarget]::Machine)
$isAgentToolsDirectoryNotThere = [string]::IsNullOrEmpty($env:RUNNER_TOOL_CACHE)
Write-Host "AGENT_TOOLSDIRECTORY deleted: $isAgentToolsDirectoryNotThere"
}
else
{
Write-Host "RUNNER_TOOL_CACHE non-empty: $env:RUNNER_TOOL_CACHE"
}

View File

@@ -1,18 +1,5 @@
$isPathUpdated = $false
$hgPath = "$Env:ProgramFiles\Mercurial\"
$latestPath = [System.Environment]::GetEnvironmentVariable('PATH', [System.EnvironmentVariableTarget]::Machine) $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."
}
$dotnetPath = "$env:USERPROFILE\.dotnet\tools" $dotnetPath = "$env:USERPROFILE\.dotnet\tools"
if ($latestPath.Contains("C:\Users\VssAdministrator\.dotnet\tools")) if ($latestPath.Contains("C:\Users\VssAdministrator\.dotnet\tools"))
{ {
@@ -31,9 +18,5 @@ else
Write-Host "$dotnetPath already in PATH" Write-Host "$dotnetPath already in PATH"
} }
if ($isPathUpdated)
{
[System.Environment]::SetEnvironmentVariable('PATH', $latestPath, [System.EnvironmentVariableTarget]::Machine)
}
$updatedPath = [System.Environment]::GetEnvironmentVariable('PATH', [System.EnvironmentVariableTarget]::Machine) $updatedPath = [System.Environment]::GetEnvironmentVariable('PATH', [System.EnvironmentVariableTarget]::Machine)
Write-Host "Windows PATH: $updatedPath" Write-Host "Windows PATH: $updatedPath"

View File

@@ -0,0 +1,16 @@
$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"