diff --git a/images/win/Windows2016-Azure.json b/images/win/Windows2016-Azure.json index 34c1abcb3..d65286497 100644 --- a/images/win/Windows2016-Azure.json +++ b/images/win/Windows2016-Azure.json @@ -82,6 +82,11 @@ "source": "{{ template_dir }}/scripts/SoftwareReport", "destination": "{{user `image_folder`}}" }, + { + "type": "file", + "source": "{{ template_dir }}/post-generation", + "destination": "C:/post-generation" + }, { "type": "file", "source": "{{ template_dir }}/scripts/Tests", diff --git a/images/win/Windows2019-Azure.json b/images/win/Windows2019-Azure.json index 10b6e5dc1..445a5968d 100644 --- a/images/win/Windows2019-Azure.json +++ b/images/win/Windows2019-Azure.json @@ -82,6 +82,11 @@ "source": "{{ template_dir }}/scripts/SoftwareReport", "destination": "{{user `image_folder`}}" }, + { + "type": "file", + "source": "{{ template_dir }}/post-generation", + "destination": "C:/post-generation" + }, { "type": "file", "source": "{{ template_dir }}/scripts/Tests", diff --git a/images/win/post-generation/Dotnet.ps1 b/images/win/post-generation/Dotnet.ps1 new file mode 100644 index 000000000..fd43757a6 --- /dev/null +++ b/images/win/post-generation/Dotnet.ps1 @@ -0,0 +1,8 @@ +$latestPath = [System.Environment]::GetEnvironmentVariable('PATH', [System.EnvironmentVariableTarget]::Machine) +$dotnetPath = "$env:USERPROFILE\.dotnet\tools" + +if (-not $latestPath.Contains($dotnetPath)) +{ + $latestPath = "$dotnetPath;$latestPath" + [System.Environment]::SetEnvironmentVariable('PATH', $latestPath, [System.EnvironmentVariableTarget]::Machine) +} \ No newline at end of file diff --git a/images/win/post-generation/RustJunction.ps1 b/images/win/post-generation/RustJunction.ps1 new file mode 100644 index 000000000..86f3fc106 --- /dev/null +++ b/images/win/post-generation/RustJunction.ps1 @@ -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" +} \ No newline at end of file diff --git a/images/win/post-generation/VSConfiguration.ps1 b/images/win/post-generation/VSConfiguration.ps1 new file mode 100644 index 000000000..0ff9d7bfb --- /dev/null +++ b/images/win/post-generation/VSConfiguration.ps1 @@ -0,0 +1,4 @@ +$vsInstallRoot = Get-VisualStudioPath +$devEnvPath = "$vsInstallRoot\Common7\IDE\devenv.exe" + +cmd.exe /c "`"$devEnvPath`" /updateconfiguration" \ No newline at end of file diff --git a/images/win/scripts/Installers/Install-Git.ps1 b/images/win/scripts/Installers/Install-Git.ps1 index 2a5ea9259..16b7ac15e 100644 --- a/images/win/scripts/Installers/Install-Git.ps1 +++ b/images/win/scripts/Installers/Install-Git.ps1 @@ -40,5 +40,10 @@ Choco-Install -PackageName hub Add-MachinePathItem "C:\Program Files\Git\bin" +# 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 ssh.dev.azure.com >> "C:\Program Files\Git\etc\ssh\ssh_known_hosts" + Invoke-PesterTests -TestFile "Git" -TestName "Git" Invoke-PesterTests -TestFile "CLI.Tools" -TestName "Hub CLI"