Merge pull request #1720 from akv-platform/al-cheb/ea-powershell-windows

[Windows] Fail Windows image building on error in generation scripts
This commit is contained in:
Maxim Lobanov
2020-10-06 10:50:47 +03:00
committed by GitHub
35 changed files with 5 additions and 81 deletions

View File

@@ -173,12 +173,6 @@
"type": "windows-restart", "type": "windows-restart",
"restart_timeout": "10m" "restart_timeout": "10m"
}, },
{
"type": "powershell",
"scripts": [
"{{ template_dir }}/scripts/Installers/Update-DockerImages.ps1"
]
},
{ {
"type": "powershell", "type": "powershell",
"valid_exit_codes": [ "valid_exit_codes": [

View File

@@ -27,10 +27,6 @@ Function Set-DefaultVariables
} }
} }
$ErrorActionPreference = "Stop"
Import-Module -Name ImageHelpers -Force -DisableNameChecking
# Define executables for cached tools # Define executables for cached tools
$toolsEnvironmentVariables = @{ $toolsEnvironmentVariables = @{
Python = @{ Python = @{

View File

@@ -62,8 +62,6 @@ Function Set-DefaultRubyVersion {
Invoke-Expression "gem update --system" Invoke-Expression "gem update --system"
} }
Import-Module -Name ImageHelpers -Force
$FeedPrefix = "https://npm.pkg.github.com" $FeedPrefix = "https://npm.pkg.github.com"
$AccessToken = $env:GITHUB_FEED_TOKEN $AccessToken = $env:GITHUB_FEED_TOKEN

View File

@@ -6,8 +6,6 @@
Write-Host "Cleanup WinSxS" Write-Host "Cleanup WinSxS"
Dism.exe /online /Cleanup-Image /StartComponentCleanup /ResetBase Dism.exe /online /Cleanup-Image /StartComponentCleanup /ResetBase
$ErrorActionPreference = 'silentlycontinue'
Write-Host "Clean up various directories" Write-Host "Clean up various directories"
@( @(
"C:\\Recovery", "C:\\Recovery",
@@ -30,4 +28,5 @@ Write-Host "Clean up various directories"
$winInstallDir = "$env:windir\\Installer" $winInstallDir = "$env:windir\\Installer"
New-Item -Path $winInstallDir -ItemType Directory -Force New-Item -Path $winInstallDir -ItemType Directory -Force
$ErrorActionPreference = 'Continue' # Remove AllUsersAllHosts profile
Remove-Item $profile.AllUsersAllHosts -Force

View File

@@ -30,6 +30,9 @@ function Disable-UserAccessControl {
Write-Host "User Access Control (UAC) has been disabled." Write-Host "User Access Control (UAC) has been disabled."
} }
# Enable $ErrorActionPreference='Stop' for AllUsersAllHosts
Add-Content -Path $profile.AllUsersAllHosts -Value '$ErrorActionPreference="Stop"'
# Set TLS1.2 # Set TLS1.2
[Net.ServicePointManager]::SecurityProtocol = [Net.ServicePointManager]::SecurityProtocol -bor "Tls12" [Net.ServicePointManager]::SecurityProtocol = [Net.ServicePointManager]::SecurityProtocol -bor "Tls12"

View File

@@ -3,8 +3,6 @@
## Desc: Install Azure CosmosDb Emulator ## Desc: Install Azure CosmosDb Emulator
#################################################################################### ####################################################################################
Import-Module -Name ImageHelpers -Force
$InstallerName = "AzureCosmosDBEmulator.msi" $InstallerName = "AzureCosmosDBEmulator.msi"
$InstallerUrl = "https://aka.ms/cosmosdb-emulator" $InstallerUrl = "https://aka.ms/cosmosdb-emulator"

View File

@@ -3,8 +3,6 @@
## Desc: Install Azure PowerShell modules ## Desc: Install Azure PowerShell modules
################################################################################ ################################################################################
$ErrorActionPreference = "Stop"
# The correct Modules need to be saved in C:\Modules # The correct Modules need to be saved in C:\Modules
$installPSModulePath = $env:PSMODULES_ROOT_FOLDER $installPSModulePath = $env:PSMODULES_ROOT_FOLDER
if (-not (Test-Path -LiteralPath $installPSModulePath)) if (-not (Test-Path -LiteralPath $installPSModulePath))

View File

@@ -3,8 +3,6 @@
## Desc: Install Google Chrome ## Desc: Install Google Chrome
################################################################################ ################################################################################
Import-Module -Name ImageHelpers -Force
# Download and install latest Chrome browser # Download and install latest Chrome browser
$ChromeInstallerFile = "chrome_installer.exe" $ChromeInstallerFile = "chrome_installer.exe"
$ChromeInstallerUrl = "https://dl.google.com/chrome/install/375.126/${ChromeInstallerFile}" $ChromeInstallerUrl = "https://dl.google.com/chrome/install/375.126/${ChromeInstallerFile}"

View File

@@ -3,8 +3,6 @@
## Desc: Install Cloud Foundry CLI ## Desc: Install Cloud Foundry CLI
################################################################################ ################################################################################
Import-Module -Name ImageHelpers
# Download the latest cf cli exe # Download the latest cf cli exe
$CloudFoundryCliName = "cf-cli.zip" $CloudFoundryCliName = "cf-cli.zip"
$CloudFoundryCliUrl = "https://packages.cloudfoundry.org/stable?release=windows64-exe&source=github" $CloudFoundryCliUrl = "https://packages.cloudfoundry.org/stable?release=windows64-exe&source=github"

View File

@@ -3,8 +3,6 @@
## Desc: Install SQL Server® Data-Tier Application Framework (DACFx) for Windows ## Desc: Install SQL Server® Data-Tier Application Framework (DACFx) for Windows
#################################################################################### ####################################################################################
Import-Module -Name ImageHelpers -Force
$InstallerName = "DacFramework.msi" $InstallerName = "DacFramework.msi"
$InstallerUrl = "https://go.microsoft.com/fwlink/?linkid=2134206" $InstallerUrl = "https://go.microsoft.com/fwlink/?linkid=2134206"

View File

@@ -3,8 +3,6 @@
## Desc: Install Mozilla Firefox ## Desc: Install Mozilla Firefox
################################################################################ ################################################################################
Import-Module -Name ImageHelpers -Force
# Install and configure Firefox browser # Install and configure Firefox browser
Write-Host "Install latest Firefox browser..." Write-Host "Install latest Firefox browser..."
$VersionsManifest = Invoke-RestMethod "https://product-details.mozilla.org/1.0/firefox_versions.json" $VersionsManifest = Invoke-RestMethod "https://product-details.mozilla.org/1.0/firefox_versions.json"

View File

@@ -3,8 +3,6 @@
## Desc: Install Git for Windows ## Desc: Install Git for Windows
################################################################################ ################################################################################
Import-Module -Name ImageHelpers
function getSimpleValue([string] $url, [string] $filename ) { function getSimpleValue([string] $url, [string] $filename ) {
$fullpath = "${env:Temp}\$filename" $fullpath = "${env:Temp}\$filename"
Invoke-WebRequest -Uri $url -OutFile $fullpath Invoke-WebRequest -Uri $url -OutFile $fullpath

View File

@@ -3,8 +3,6 @@
## Desc: Install various JDKs and java tools ## Desc: Install various JDKs and java tools
################################################################################ ################################################################################
Import-Module -Name ImageHelpers -Force
function Set-JavaPath { function Set-JavaPath {
param ( param (
[string] $Version, [string] $Version,

View File

@@ -3,8 +3,6 @@
## Desc: Install the latest version of Miniconda and set $env:CONDA ## Desc: Install the latest version of Miniconda and set $env:CONDA
################################################################################ ################################################################################
Import-Module -Name ImageHelpers -Force
$CondaDestination = "C:\Miniconda" $CondaDestination = "C:\Miniconda"
# Lock to Miniconda 4.6 until we do the work to run `conda init` for the vsts user # Lock to Miniconda 4.6 until we do the work to run `conda init` for the vsts user

View File

@@ -3,8 +3,6 @@
## Desc: Install .NET 4.8 ## Desc: Install .NET 4.8
################################################################################ ################################################################################
Import-Module -Name ImageHelpers -Force
# .NET 4.8 Dev pack # .NET 4.8 Dev pack
$InstallerName = "ndp48-devpack-enu.exe" $InstallerName = "ndp48-devpack-enu.exe"
$InstallerUrl = "https://download.visualstudio.microsoft.com/download/pr/014120d7-d689-4305-befd-3cb711108212/0307177e14752e359fde5423ab583e43/${InstallerName}" $InstallerUrl = "https://download.visualstudio.microsoft.com/download/pr/014120d7-d689-4305-befd-3cb711108212/0307177e14752e359fde5423ab583e43/${InstallerName}"

View File

@@ -4,8 +4,6 @@
## Must run after python is configured ## Must run after python is configured
################################################################################ ################################################################################
Import-Module -Name ImageHelpers -Force
$PrefixPath = 'C:\npm\prefix' $PrefixPath = 'C:\npm\prefix'
$CachePath = 'C:\npm\cache' $CachePath = 'C:\npm\cache'

View File

@@ -2,9 +2,6 @@
## File: Install-PHP.ps1 ## File: Install-PHP.ps1
## Desc: Install PHP ## Desc: Install PHP
################################################################################ ################################################################################
$ErrorActionPreference = "Stop"
Import-Module -Name ImageHelpers
# Install latest PHP in chocolatey # Install latest PHP in chocolatey
$installDir = "c:\tools\php" $installDir = "c:\tools\php"

View File

@@ -1,5 +1,3 @@
$ErrorActionPreference = "Stop"
#Define user and password for PostgreSQL database #Define user and password for PostgreSQL database
$pgUser = "postgres" $pgUser = "postgres"
$pgPwd = "root" $pgPwd = "root"

View File

@@ -1,5 +1,3 @@
$ErrorActionPreference = "Stop"
# Set TLS1.2 # Set TLS1.2
[Net.ServicePointManager]::SecurityProtocol = [Net.ServicePointManager]::SecurityProtocol -bor "Tls12" [Net.ServicePointManager]::SecurityProtocol = [Net.ServicePointManager]::SecurityProtocol -bor "Tls12"

View File

@@ -82,9 +82,6 @@ function Install-PyPy
} }
} }
$ErrorActionPreference = "Stop"
Import-Module -Name ImageHelpers -Force -DisableNameChecking
# Get PyPy content from toolset # Get PyPy content from toolset
$pypyTools = Get-ToolsetContent | Select-Object -ExpandProperty toolcache | Where-Object Name -eq "PyPy" $pypyTools = Get-ToolsetContent | Select-Object -ExpandProperty toolcache | Where-Object Name -eq "PyPy"

View File

@@ -3,8 +3,6 @@
## Desc: Install Rust for Windows ## Desc: Install Rust for Windows
################################################################################ ################################################################################
Import-Module -Name ImageHelpers
# Rust Env # Rust Env
$env:RUSTUP_HOME = "C:\Rust\.rustup" $env:RUSTUP_HOME = "C:\Rust\.rustup"
$env:CARGO_HOME = "C:\Rust\.cargo" $env:CARGO_HOME = "C:\Rust\.cargo"

View File

@@ -3,8 +3,6 @@
## Desc: Install SQL PowerShell tool ## Desc: Install SQL PowerShell tool
################################################################################ ################################################################################
Import-Module -Name ImageHelpers -Force
$BaseUrl = "https://download.microsoft.com/download/8/7/2/872BCECA-C849-4B40-8EBE-21D48CDF1456/ENU/x64" $BaseUrl = "https://download.microsoft.com/download/8/7/2/872BCECA-C849-4B40-8EBE-21D48CDF1456/ENU/x64"
# install required MSIs # install required MSIs

View File

@@ -2,9 +2,6 @@
## File: Install-Sbt.ps1 ## File: Install-Sbt.ps1
## Desc: Install sbt for Windows ## Desc: Install sbt for Windows
################################################################################ ################################################################################
$ErrorActionPreference = "Stop"
Import-Module -Name ImageHelpers
# Install the latest version of sbt. # Install the latest version of sbt.
# See https://chocolatey.org/packages/sbt # See https://chocolatey.org/packages/sbt

View File

@@ -3,8 +3,6 @@
## Desc: Install Selenium Server standalone ## Desc: Install Selenium Server standalone
################################################################################ ################################################################################
Import-Module -Name ImageHelpers -Force
# Acquire latest Selenium release number from GitHub API # Acquire latest Selenium release number from GitHub API
$latestReleaseUrl = "https://api.github.com/repos/SeleniumHQ/selenium/releases/latest" $latestReleaseUrl = "https://api.github.com/repos/SeleniumHQ/selenium/releases/latest"
try { try {

View File

@@ -29,10 +29,6 @@ Function Install-Asset {
Pop-Location Pop-Location
} }
$ErrorActionPreference = "Stop"
Import-Module -Name ImageHelpers -Force
# Get toolcache content from toolset # Get toolcache content from toolset
$ToolsToInstall = @("Python", "Node", "Boost", "Go") $ToolsToInstall = @("Python", "Node", "Boost", "Go")

View File

@@ -3,8 +3,6 @@
## Desc: Install Visual Studio ## Desc: Install Visual Studio
################################################################################ ################################################################################
$ErrorActionPreference = "Stop"
$toolset = Get-ToolsetContent $toolset = Get-ToolsetContent
$requiredComponents = $toolset.visualStudio.workloads | ForEach-Object { "--add $_" } $requiredComponents = $toolset.visualStudio.workloads | ForEach-Object { "--add $_" }
$workLoads = @( $workLoads = @(

View File

@@ -3,8 +3,6 @@
## Desc: Install vcpkg ## Desc: Install vcpkg
################################################################################ ################################################################################
Import-Module -Name ImageHelpers -Force
$Uri = 'https://github.com/Microsoft/vcpkg.git' $Uri = 'https://github.com/Microsoft/vcpkg.git'
$InstallDir = 'C:\vcpkg' $InstallDir = 'C:\vcpkg'
$VcpkgExecPath = 'vcpkg.exe' $VcpkgExecPath = 'vcpkg.exe'

View File

@@ -3,8 +3,6 @@
## Desc: Install the Visual Studio Extensions from toolset.json ## Desc: Install the Visual Studio Extensions from toolset.json
################################################################################### ###################################################################################
$ErrorActionPreference = "Stop"
$toolset = Get-ToolsetContent $toolset = Get-ToolsetContent
$vsixPackagesList = $toolset.visualStudio.vsix $vsixPackagesList = $toolset.visualStudio.vsix
if (-not $vsixPackagesList) { if (-not $vsixPackagesList) {

View File

@@ -4,9 +4,6 @@
################################################################################ ################################################################################
# Requires Windows SDK with the same version number as the WDK # Requires Windows SDK with the same version number as the WDK
Import-Module -Name ImageHelpers -Force
if (Test-IsWin19) if (Test-IsWin19)
{ {
$winSdkUrl = "https://go.microsoft.com/fwlink/p/?linkid=2120843" $winSdkUrl = "https://go.microsoft.com/fwlink/p/?linkid=2120843"

View File

@@ -3,8 +3,6 @@
## Desc: Install Windows Application Driver (WinAppDriver) ## Desc: Install Windows Application Driver (WinAppDriver)
#################################################################################### ####################################################################################
Import-Module -Name ImageHelpers -Force
$InstallerName = "WindowsApplicationDriver.msi" $InstallerName = "WindowsApplicationDriver.msi"
$InstallerUrl = "https://github.com/Microsoft/WinAppDriver/releases/download/v1.1/${InstallerName}" $InstallerUrl = "https://github.com/Microsoft/WinAppDriver/releases/download/v1.1/${InstallerName}"

View File

@@ -3,8 +3,6 @@
## Desc: Install WIX. ## Desc: Install WIX.
################################################################################ ################################################################################
Import-Module -Name ImageHelpers -Force
Choco-Install -PackageName wixtoolset -ArgumentList "--force" Choco-Install -PackageName wixtoolset -ArgumentList "--force"
if(Test-IsWin19) if(Test-IsWin19)

View File

@@ -3,8 +3,6 @@
## Desc: Install and update Android SDK and tools ## Desc: Install and update Android SDK and tools
################################################################################ ################################################################################
$ErrorActionPreference = "Stop"
# Install the standard Android SDK licenses. In the past, there wasn't a better way to do this, # Install the standard Android SDK licenses. In the past, there wasn't a better way to do this,
# so we are base64-encoding a zip of the licenses directory from another installation. # so we are base64-encoding a zip of the licenses directory from another installation.
# To create this base64 string, create a zip file that contains nothing but a 'licenses' folder, # To create this base64 string, create a zip file that contains nothing but a 'licenses' folder,

View File

@@ -3,8 +3,6 @@
## Desc: Install SQL Server Data Tools for Windows ## Desc: Install SQL Server Data Tools for Windows
################################################################################ ################################################################################
Import-Module -Name ImageHelpers -Force
#SSDT for Visual Studio 2017 #SSDT for Visual Studio 2017
#The link down below points to the latest version of SSDT for Visual Studio 2017 #The link down below points to the latest version of SSDT for Visual Studio 2017
$InstallerName = "SSDT-Setup-ENU.exe" $InstallerName = "SSDT-Setup-ENU.exe"

View File

@@ -3,8 +3,6 @@
## Desc: Install Windows 8.1 SDK ## Desc: Install Windows 8.1 SDK
################################################################################ ################################################################################
Import-Module -Name ImageHelpers -Force
$InstallerName = "sdksetup.exe" $InstallerName = "sdksetup.exe"
$InstallerUrl = "http://download.microsoft.com/download/B/0/C/B0C80BA3-8AD6-4958-810B-6882485230B5/standalonesdk/${InstallerName}" $InstallerUrl = "http://download.microsoft.com/download/B/0/C/B0C80BA3-8AD6-4958-810B-6882485230B5/standalonesdk/${InstallerName}"
$ArgumentList = ("/quiet", "/norestart") $ArgumentList = ("/quiet", "/norestart")

View File

@@ -1,5 +1,3 @@
$ErrorActionPreference = "Stop"
Import-Module MarkdownPS Import-Module MarkdownPS
Import-Module (Join-Path $PSScriptRoot "SoftwareReport.Android.psm1") -DisableNameChecking Import-Module (Join-Path $PSScriptRoot "SoftwareReport.Android.psm1") -DisableNameChecking
Import-Module (Join-Path $PSScriptRoot "SoftwareReport.Browsers.psm1") -DisableNameChecking Import-Module (Join-Path $PSScriptRoot "SoftwareReport.Browsers.psm1") -DisableNameChecking