From 0263bdd53e651fade269b4ab852b2807c686f510 Mon Sep 17 00:00:00 2001 From: Vasilii Polikarpov <126792224+vpolikarpov-akvelon@users.noreply.github.com> Date: Thu, 16 Nov 2023 11:20:11 +0100 Subject: [PATCH] [Windows] Rename image build scripts (#8808) --- ...tialize-VM.ps1 => Configure-BaseImage.ps1} | 8 +-- ...erMode.ps1 => Configure-DeveloperMode.ps1} | 2 +- ...Debugger.ps1 => Configure-Diagnostics.ps1} | 7 ++- ....ps1 => Configure-DotnetSecureChannel.ps1} | 8 +-- ...geData.ps1 => Configure-ImageDataFile.ps1} | 12 ++--- .../{Finalize-VM.ps1 => Configure-System.ps1} | 46 ++++++++--------- .../build/Configure-SystemEnvironment.ps1 | 9 ++++ .../{Warmup-User.ps1 => Configure-User.ps1} | 4 +- ...irus.ps1 => Configure-WindowsDefender.ps1} | 5 ++ .../{Install-AWS.ps1 => Install-AWSTools.ps1} | 6 +-- ...hiveCache.ps1 => Install-ActionsCache.ps1} | 8 ++- .../scripts/build/Install-AzureCli.ps1 | 2 +- ...stall-Choco.ps1 => Install-Chocolatey.ps1} | 5 ++ .../build/Install-ChocolateyPackages.ps1 | 12 +++++ .../windows/scripts/build/Install-Chrome.ps1 | 2 +- .../scripts/build/Install-CommonUtils.ps1 | 8 --- ...-Compose.ps1 => Install-DockerCompose.ps1} | 0 ...-WinCred.ps1 => Install-DockerWinCred.ps1} | 0 .../scripts/build/Install-DotnetSDK.ps1 | 2 +- ...nstall-Edge.ps1 => Install-EdgeDriver.ps1} | 7 ++- .../windows/scripts/build/Install-Firefox.ps1 | 2 +- ...{Run-NGen.ps1 => Install-NativeImages.ps1} | 7 ++- ...Install-NodeLts.ps1 => Install-NodeJS.ps1} | 2 +- images/windows/scripts/build/Install-Pipx.ps1 | 28 +++++++++-- .../scripts/build/Install-PipxPackages.ps1 | 12 ----- .../build/Install-PowerShellModules.ps1 | 5 ++ ...es.ps1 => Install-PowershellAzModules.ps1} | 21 +++----- images/windows/scripts/build/Install-PyPy.ps1 | 2 +- images/windows/scripts/build/Install-Ruby.ps1 | 47 ++++++----------- .../scripts/build/Install-SQLOLEDBDriver.ps1 | 2 +- ...tall-Vsix.ps1 => Install-VSExtensions.ps1} | 4 +- ...nstall-VS.ps1 => Install-VisualStudio.ps1} | 17 +++---- ... => Install-WindowsUpdatesAfterReboot.ps1} | 4 +- images/windows/scripts/build/Install-Zstd.ps1 | 2 +- ...erator.ps1 => Generate-SoftwareReport.ps1} | 0 .../windows/scripts/helpers/ImageHelpers.psm1 | 7 +-- .../TestsHelpers.ps1 => tests/Helpers.psm1} | 29 +++++++---- images/windows/templates/windows-2019.json | 50 ++++++++++--------- images/windows/templates/windows-2022.json | 50 ++++++++++--------- 39 files changed, 234 insertions(+), 210 deletions(-) rename images/windows/scripts/build/{Initialize-VM.ps1 => Configure-BaseImage.ps1} (95%) rename images/windows/scripts/build/{Enable-DeveloperMode.ps1 => Configure-DeveloperMode.ps1} (94%) rename images/windows/scripts/build/{Disable-JITDebugger.ps1 => Configure-Diagnostics.ps1} (80%) rename images/windows/scripts/build/{Update-DotnetTLS.ps1 => Configure-DotnetSecureChannel.ps1} (77%) rename images/windows/scripts/build/{Update-ImageData.ps1 => Configure-ImageDataFile.ps1} (85%) rename images/windows/scripts/build/{Finalize-VM.ps1 => Configure-System.ps1} (90%) create mode 100644 images/windows/scripts/build/Configure-SystemEnvironment.ps1 rename images/windows/scripts/build/{Warmup-User.ps1 => Configure-User.ps1} (94%) rename images/windows/scripts/build/{Configure-Antivirus.ps1 => Configure-WindowsDefender.ps1} (85%) rename images/windows/scripts/build/{Install-AWS.ps1 => Install-AWSTools.ps1} (87%) rename images/windows/scripts/build/{Install-ActionArchiveCache.ps1 => Install-ActionsCache.ps1} (77%) rename images/windows/scripts/build/{Install-Choco.ps1 => Install-Chocolatey.ps1} (84%) create mode 100644 images/windows/scripts/build/Install-ChocolateyPackages.ps1 delete mode 100644 images/windows/scripts/build/Install-CommonUtils.ps1 rename images/windows/scripts/build/{Install-Docker-Compose.ps1 => Install-DockerCompose.ps1} (100%) rename images/windows/scripts/build/{Install-Docker-WinCred.ps1 => Install-DockerWinCred.ps1} (100%) rename images/windows/scripts/build/{Install-Edge.ps1 => Install-EdgeDriver.ps1} (94%) rename images/windows/scripts/build/{Run-NGen.ps1 => Install-NativeImages.ps1} (62%) rename images/windows/scripts/build/{Install-NodeLts.ps1 => Install-NodeJS.ps1} (97%) delete mode 100644 images/windows/scripts/build/Install-PipxPackages.ps1 rename images/windows/scripts/build/{Install-AzureModules.ps1 => Install-PowershellAzModules.ps1} (81%) rename images/windows/scripts/build/{Install-Vsix.ps1 => Install-VSExtensions.ps1} (92%) rename images/windows/scripts/build/{Install-VS.ps1 => Install-VisualStudio.ps1} (83%) rename images/windows/scripts/build/{Wait-WindowsUpdatesForInstall.ps1 => Install-WindowsUpdatesAfterReboot.ps1} (80%) rename images/windows/scripts/docs-gen/{SoftwareReport.Generator.ps1 => Generate-SoftwareReport.ps1} (100%) rename images/windows/scripts/{helpers/TestsHelpers.ps1 => tests/Helpers.psm1} (94%) diff --git a/images/windows/scripts/build/Initialize-VM.ps1 b/images/windows/scripts/build/Configure-BaseImage.ps1 similarity index 95% rename from images/windows/scripts/build/Initialize-VM.ps1 rename to images/windows/scripts/build/Configure-BaseImage.ps1 index b3d18a605..514e55edb 100644 --- a/images/windows/scripts/build/Initialize-VM.ps1 +++ b/images/windows/scripts/build/Configure-BaseImage.ps1 @@ -1,6 +1,6 @@ ################################################################################ -## File: Initialize-VM.ps1 -## Desc: VM initialization script, machine level configuration +## File: Configure-BaseImage.ps1 +## Desc: Prepare the base image for software installation ################################################################################ function Disable-InternetExplorerESC { @@ -11,7 +11,7 @@ function Disable-InternetExplorerESC { $ieProcess = Get-Process -Name Explorer -ErrorAction SilentlyContinue - if ($ieProcess){ + if ($ieProcess) { Stop-Process -Name Explorer -Force -ErrorAction Continue } @@ -65,7 +65,7 @@ Write-Host "Disable IE ESC" Disable-InternetExplorerESC Write-Host "Setting local execution policy" -Set-ExecutionPolicy -ExecutionPolicy Unrestricted -Scope LocalMachine -ErrorAction Continue | Out-Null +Set-ExecutionPolicy -ExecutionPolicy Unrestricted -Scope LocalMachine -ErrorAction Continue | Out-Null Get-ExecutionPolicy -List Write-Host "Enable long path behavior" diff --git a/images/windows/scripts/build/Enable-DeveloperMode.ps1 b/images/windows/scripts/build/Configure-DeveloperMode.ps1 similarity index 94% rename from images/windows/scripts/build/Enable-DeveloperMode.ps1 rename to images/windows/scripts/build/Configure-DeveloperMode.ps1 index cd3e7294e..28e6aa4f9 100644 --- a/images/windows/scripts/build/Enable-DeveloperMode.ps1 +++ b/images/windows/scripts/build/Configure-DeveloperMode.ps1 @@ -1,5 +1,5 @@ ################################################################################ -## File: Enable-DeveloperMode.ps1 +## File: Configure-DeveloperMode.ps1 ## Desc: Enables Developer Mode by toggling registry setting. Developer Mode is required to enable certain tools (e.g. WinAppDriver). ################################################################################ diff --git a/images/windows/scripts/build/Disable-JITDebugger.ps1 b/images/windows/scripts/build/Configure-Diagnostics.ps1 similarity index 80% rename from images/windows/scripts/build/Disable-JITDebugger.ps1 rename to images/windows/scripts/build/Configure-Diagnostics.ps1 index b500a2946..06677cd74 100644 --- a/images/windows/scripts/build/Disable-JITDebugger.ps1 +++ b/images/windows/scripts/build/Configure-Diagnostics.ps1 @@ -1,3 +1,8 @@ +################################################################################ +## File: Configure-Diagnostics.ps1 +## Desc: Disables Just-In-Time Debugger and Windows Error Reporting +################################################################################ + Write-Host "Disable Just-In-Time Debugger" # Turn off Application Error Debugger @@ -13,4 +18,4 @@ New-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\Windows Error Reporting # Send all reports to the user's queue New-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\Windows Error Reporting" -Name ForceQueue -Value 1 -Type DWORD -Force # Default consent choice 1 - Always ask (default) -New-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\Windows Error Reporting\Consent" -Name DefaultConsent -Value 1 -Type DWORD -Force \ No newline at end of file +New-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\Windows Error Reporting\Consent" -Name DefaultConsent -Value 1 -Type DWORD -Force diff --git a/images/windows/scripts/build/Update-DotnetTLS.ps1 b/images/windows/scripts/build/Configure-DotnetSecureChannel.ps1 similarity index 77% rename from images/windows/scripts/build/Update-DotnetTLS.ps1 rename to images/windows/scripts/build/Configure-DotnetSecureChannel.ps1 index a00477d54..54732fed3 100644 --- a/images/windows/scripts/build/Update-DotnetTLS.ps1 +++ b/images/windows/scripts/build/Configure-DotnetSecureChannel.ps1 @@ -1,16 +1,16 @@ ################################################################################ -## File: Update-DotnetTLS.ps1 -## Desc: Update DotNetFramework security protocol to TLS 1.2 +## File: Configure-DotnetSecureChannel.ps1 +## Desc: Configure .NET to use TLS 1.2 ################################################################################ $registryPath = "HKLM:\SOFTWARE\Microsoft\.NETFramework\v4.0.30319" $name = "SchUseStrongCrypto" $value = "1" -if(Test-Path $registryPath){ +if (Test-Path $registryPath) { Set-ItemProperty -Path $registryPath -Name $name -Value $value -Type DWORD } $registryPath = "HKLM:\SOFTWARE\Wow6432Node\Microsoft\.NETFramework\v4.0.30319" -if(Test-Path $registryPath){ +if (Test-Path $registryPath) { Set-ItemProperty -Path $registryPath -Name $name -Value $value -Type DWORD } diff --git a/images/windows/scripts/build/Update-ImageData.ps1 b/images/windows/scripts/build/Configure-ImageDataFile.ps1 similarity index 85% rename from images/windows/scripts/build/Update-ImageData.ps1 rename to images/windows/scripts/build/Configure-ImageDataFile.ps1 index fa5abbd94..d4ef6b067 100644 --- a/images/windows/scripts/build/Update-ImageData.ps1 +++ b/images/windows/scripts/build/Configure-ImageDataFile.ps1 @@ -1,3 +1,8 @@ +################################################################################ +## File: Configure-ImageDataFile.ps1 +## Desc: Creates a JSON file with information about the image +################################################################################ + $os = Get-CimInstance -ClassName Win32_OperatingSystem $caption = $os.Caption $osName = $caption.Substring(0, $caption.LastIndexOf(" ")) @@ -36,10 +41,3 @@ $json = @" "@ $json | Out-File -FilePath $imageDataFile - - -# Set static env vars -setx ImageVersion $env:IMAGE_VERSION /m -setx ImageOS $env:IMAGE_OS /m -setx AGENT_TOOLSDIRECTORY $env:AGENT_TOOLSDIRECTORY /m -setx ACTIONS_RUNNER_ACTION_ARCHIVE_CACHE $env:ACTIONS_RUNNER_ACTION_ARCHIVE_CACHE /m diff --git a/images/windows/scripts/build/Finalize-VM.ps1 b/images/windows/scripts/build/Configure-System.ps1 similarity index 90% rename from images/windows/scripts/build/Finalize-VM.ps1 rename to images/windows/scripts/build/Configure-System.ps1 index 8e64259e5..853db47ea 100644 --- a/images/windows/scripts/build/Finalize-VM.ps1 +++ b/images/windows/scripts/build/Configure-System.ps1 @@ -1,6 +1,6 @@ ################################################################################ -## File: Finalize-VM.ps1 -## Desc: Clean up temp folders after installs to save space +## File: Configure-System.ps1 +## Desc: Applies various configuration settings to the final image ################################################################################ Write-Host "Cleanup WinSxS" @@ -46,24 +46,24 @@ cmd /c "icacls $env:SystemRoot\Temp /grant Users:f /t /c /q 2>&1" | Out-Null # Registry settings $registrySettings = @( - @{Path = "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU"; Name = "AUOptions"; Value = 1; PropertyType = "DWORD"} - @{Path = "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU"; Name = "NoAutoUpdate"; Value = 1; PropertyType = "DWORD"} - @{Path = "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate"; Name = "DoNotConnectToWindowsUpdateInternetLocations"; Value = 1; PropertyType = "DWORD"} - @{Path = "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate"; Name = "DisableWindowsUpdateAccess"; Value = 1; PropertyType = "DWORD"} - @{Path = "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Device Metadata"; Name = "PreventDeviceMetadataFromNetwork"; Value = 1; PropertyType = "DWORD"} - @{Path = "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\DataCollection"; Name = "AllowTelemetry"; Value = 0; PropertyType = "DWORD"} - @{Path = "HKLM:\SOFTWARE\Policies\Microsoft\SQMClient\Windows"; Name = "CEIPEnable"; Value = 0; PropertyType = "DWORD"} - @{Path = "HKLM:\SOFTWARE\Policies\Microsoft\Windows\AppCompat"; Name = "AITEnable"; Value = 0; PropertyType = "DWORD"} - @{Path = "HKLM:\SOFTWARE\Policies\Microsoft\Windows\AppCompat"; Name = "DisableUAR"; Value = 1; PropertyType = "DWORD"} - @{Path = "HKLM:\Software\Policies\Microsoft\Windows\DataCollection"; Name = "AllowTelemetry"; Value = 0; PropertyType = "DWORD"} - @{Path = "HKLM:\SOFTWARE\Wow6432Node\Policies\Microsoft\Windows\DataCollection"; Name = "AllowTelemetry"; Value = 0; PropertyType = "DWORD"} - @{Path = "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Schedule\Maintenance"; Name = "MaintenanceDisabled"; Value = 1; PropertyType = "DWORD"} - @{Path = "HKLM:\SOFTWARE\Policies\Microsoft\MRT"; Name = "DontOfferThroughWUAU"; Value = 1; PropertyType = "DWORD"} - @{Path = "HKLM:\SOFTWARE\Policies\Microsoft\MRT"; Name = "DontReportInfectionInformation"; Value = 1; PropertyType = "DWORD"} - @{Path = "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search"; Name = "AllowCortana"; Value = 0; PropertyType = "DWORD"} - @{Path = "HKLM:\SYSTEM\CurrentControlSet\Control"; Name = "ServicesPipeTimeout"; Value = 120000; PropertyType = "DWORD"} - @{Path = "HKLM:\SYSTEM\CurrentControlSet\Control\WMI\AutoLogger\AutoLogger-Diagtrack-Listener"; Name = "Start"; Value = 0; PropertyType = "DWORD"} - @{Path = "HKLM:\SYSTEM\CurrentControlSet\Control\WMI\AutoLogger\SQMLogger"; Name = "Start"; Value = 0; PropertyType = "DWORD"} + @{Path = "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU"; Name = "AUOptions"; Value = 1; PropertyType = "DWORD" } + @{Path = "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU"; Name = "NoAutoUpdate"; Value = 1; PropertyType = "DWORD" } + @{Path = "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate"; Name = "DoNotConnectToWindowsUpdateInternetLocations"; Value = 1; PropertyType = "DWORD" } + @{Path = "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate"; Name = "DisableWindowsUpdateAccess"; Value = 1; PropertyType = "DWORD" } + @{Path = "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Device Metadata"; Name = "PreventDeviceMetadataFromNetwork"; Value = 1; PropertyType = "DWORD" } + @{Path = "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\DataCollection"; Name = "AllowTelemetry"; Value = 0; PropertyType = "DWORD" } + @{Path = "HKLM:\SOFTWARE\Policies\Microsoft\SQMClient\Windows"; Name = "CEIPEnable"; Value = 0; PropertyType = "DWORD" } + @{Path = "HKLM:\SOFTWARE\Policies\Microsoft\Windows\AppCompat"; Name = "AITEnable"; Value = 0; PropertyType = "DWORD" } + @{Path = "HKLM:\SOFTWARE\Policies\Microsoft\Windows\AppCompat"; Name = "DisableUAR"; Value = 1; PropertyType = "DWORD" } + @{Path = "HKLM:\Software\Policies\Microsoft\Windows\DataCollection"; Name = "AllowTelemetry"; Value = 0; PropertyType = "DWORD" } + @{Path = "HKLM:\SOFTWARE\Wow6432Node\Policies\Microsoft\Windows\DataCollection"; Name = "AllowTelemetry"; Value = 0; PropertyType = "DWORD" } + @{Path = "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Schedule\Maintenance"; Name = "MaintenanceDisabled"; Value = 1; PropertyType = "DWORD" } + @{Path = "HKLM:\SOFTWARE\Policies\Microsoft\MRT"; Name = "DontOfferThroughWUAU"; Value = 1; PropertyType = "DWORD" } + @{Path = "HKLM:\SOFTWARE\Policies\Microsoft\MRT"; Name = "DontReportInfectionInformation"; Value = 1; PropertyType = "DWORD" } + @{Path = "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search"; Name = "AllowCortana"; Value = 0; PropertyType = "DWORD" } + @{Path = "HKLM:\SYSTEM\CurrentControlSet\Control"; Name = "ServicesPipeTimeout"; Value = 120000; PropertyType = "DWORD" } + @{Path = "HKLM:\SYSTEM\CurrentControlSet\Control\WMI\AutoLogger\AutoLogger-Diagtrack-Listener"; Name = "Start"; Value = 0; PropertyType = "DWORD" } + @{Path = "HKLM:\SYSTEM\CurrentControlSet\Control\WMI\AutoLogger\SQMLogger"; Name = "Start"; Value = 0; PropertyType = "DWORD" } ) $registrySettings | ForEach-Object { @@ -139,9 +139,9 @@ $allTasksInTaskPath | ForEach-Object { } | Out-Null $disableTaskNames = @( - @{TaskPath = "\Microsoft\Windows\.NET Framework\"; TaskName = ".NET Framework NGEN v4.0.30319"} - @{TaskPath = "\Microsoft\Windows\.NET Framework\"; TaskName = ".NET Framework NGEN v4.0.30319 64"} - @{TaskPath = "\Microsoft\Windows\AppID\"; TaskName = "SmartScreenSpecific"} + @{TaskPath = "\Microsoft\Windows\.NET Framework\"; TaskName = ".NET Framework NGEN v4.0.30319" } + @{TaskPath = "\Microsoft\Windows\.NET Framework\"; TaskName = ".NET Framework NGEN v4.0.30319 64" } + @{TaskPath = "\Microsoft\Windows\AppID\"; TaskName = "SmartScreenSpecific" } ) $disableTaskNames | ForEach-Object { diff --git a/images/windows/scripts/build/Configure-SystemEnvironment.ps1 b/images/windows/scripts/build/Configure-SystemEnvironment.ps1 new file mode 100644 index 000000000..f3745ae40 --- /dev/null +++ b/images/windows/scripts/build/Configure-SystemEnvironment.ps1 @@ -0,0 +1,9 @@ +################################################################################ +## File: Configure-SystemEnvironment.ps1 +## Desc: Configures system environment variables +################################################################################ + +setx ImageVersion $env:IMAGE_VERSION /m +setx ImageOS $env:IMAGE_OS /m +setx AGENT_TOOLSDIRECTORY $env:AGENT_TOOLSDIRECTORY /m +setx ACTIONS_RUNNER_ACTION_ARCHIVE_CACHE $env:ACTIONS_RUNNER_ACTION_ARCHIVE_CACHE /m diff --git a/images/windows/scripts/build/Warmup-User.ps1 b/images/windows/scripts/build/Configure-User.ps1 similarity index 94% rename from images/windows/scripts/build/Warmup-User.ps1 rename to images/windows/scripts/build/Configure-User.ps1 index 4cb9808e6..967ea4923 100644 --- a/images/windows/scripts/build/Warmup-User.ps1 +++ b/images/windows/scripts/build/Configure-User.ps1 @@ -1,5 +1,5 @@ ################################################################################ -## File: Warmup-User.ps1 +## File: Configure-User.ps1 ## Desc: Performs user part of warm up and moves data to C:\Users\Default ################################################################################ @@ -31,4 +31,4 @@ New-ItemProperty -Path $RegistryKeyPath -Name CacheType -PropertyType DWORD -Val reg.exe copy HKCU\Software\TortoiseSVN HKLM\DEFAULT\Software\TortoiseSVN /s reg.exe unload HKLM\DEFAULT -Write-Host "Warmup-User.ps1 - completed" +Write-Host "Configure-User.ps1 - completed" diff --git a/images/windows/scripts/build/Configure-Antivirus.ps1 b/images/windows/scripts/build/Configure-WindowsDefender.ps1 similarity index 85% rename from images/windows/scripts/build/Configure-Antivirus.ps1 rename to images/windows/scripts/build/Configure-WindowsDefender.ps1 index d4aed1985..c84d47eb5 100644 --- a/images/windows/scripts/build/Configure-Antivirus.ps1 +++ b/images/windows/scripts/build/Configure-WindowsDefender.ps1 @@ -1,3 +1,8 @@ +################################################################################ +## File: Configure-WindowsDefender.ps1 +## Desc: Disables Windows Defender +################################################################################ + Write-Host "Disable Windows Defender..." $avPreference = @( @{DisableArchiveScanning = $true} diff --git a/images/windows/scripts/build/Install-AWS.ps1 b/images/windows/scripts/build/Install-AWSTools.ps1 similarity index 87% rename from images/windows/scripts/build/Install-AWS.ps1 rename to images/windows/scripts/build/Install-AWSTools.ps1 index 347525439..5fdd8f949 100644 --- a/images/windows/scripts/build/Install-AWS.ps1 +++ b/images/windows/scripts/build/Install-AWSTools.ps1 @@ -1,6 +1,6 @@ ################################################################################ -## File: Install-AWS.ps1 -## Desc: Install AWS tools(AWS CLI, Session Manager Plugin for the AWS CLI, AWS SAM CLI) +## File: Install-AWSTools.ps1 +## Desc: Install AWS tools: CLI, Session Manager Plugin, AWS SAM CLI ## Supply chain security: AWS CLI - managed by package manager, Session Manager Plugin for the AWS CLI - missing, AWS SAM CLI - checksum validation ################################################################################ @@ -11,7 +11,7 @@ Choco-Install -PackageName awscli $sessionManagerName = "SessionManagerPluginSetup.exe" $sessionManagerUrl = "https://s3.amazonaws.com/session-manager-downloads/plugin/latest/windows/$sessionManagerName" $sessionManagerSignatureThumbprint = "FF457E5732E98A9F156E657F8CC7C4432507C3BB" -Install-Binary -Url $sessionManagerUrl -Name $sessionManagerName -ArgumentList ("/silent", "/install") -ExpectedSignature $sessionManagerSignatureThumbprint +Install-Binary -Url $sessionManagerUrl -Name $sessionManagerName -ArgumentList ("/silent", "/install") -ExpectedSignature $sessionManagerSignatureThumbprint $env:Path = $env:Path + ";$env:ProgramFiles\Amazon\SessionManagerPlugin\bin" # Install AWS SAM CLI diff --git a/images/windows/scripts/build/Install-ActionArchiveCache.ps1 b/images/windows/scripts/build/Install-ActionsCache.ps1 similarity index 77% rename from images/windows/scripts/build/Install-ActionArchiveCache.ps1 rename to images/windows/scripts/build/Install-ActionsCache.ps1 index 4f4bc00b5..05c41a5ff 100644 --- a/images/windows/scripts/build/Install-ActionArchiveCache.ps1 +++ b/images/windows/scripts/build/Install-ActionsCache.ps1 @@ -1,12 +1,10 @@ ################################################################################ -## File: Install-ActionArchiveCache.ps1 -## Desc: Download latest release from https://github.com/actions/action-versions -## and un-zip to C:\actionarchivecache +## File: Install-ActionsCache.ps1 +## Desc: Downloads latest release from https://github.com/actions/action-versions ## Maintainer: #actions-runtime and @TingluoHuang ################################################################################ -if (-not (Test-Path $env:ACTIONS_RUNNER_ACTION_ARCHIVE_CACHE)) -{ +if (-not (Test-Path $env:ACTIONS_RUNNER_ACTION_ARCHIVE_CACHE)) { Write-Host "Creating action archive cache folder" New-Item -ItemType Directory -Path $env:ACTIONS_RUNNER_ACTION_ARCHIVE_CACHE | Out-Null } diff --git a/images/windows/scripts/build/Install-AzureCli.ps1 b/images/windows/scripts/build/Install-AzureCli.ps1 index fe5c5ca33..a4ff45e08 100644 --- a/images/windows/scripts/build/Install-AzureCli.ps1 +++ b/images/windows/scripts/build/Install-AzureCli.ps1 @@ -1,6 +1,6 @@ ################################################################################ ## File: Install-AzureCli.ps1 -## Desc: Install Azure CLI +## Desc: Install and warm-up Azure CLI ################################################################################ Write-Host 'Install the latest Azure CLI release' diff --git a/images/windows/scripts/build/Install-Choco.ps1 b/images/windows/scripts/build/Install-Chocolatey.ps1 similarity index 84% rename from images/windows/scripts/build/Install-Choco.ps1 rename to images/windows/scripts/build/Install-Chocolatey.ps1 index 889c350d3..afd481b8a 100644 --- a/images/windows/scripts/build/Install-Choco.ps1 +++ b/images/windows/scripts/build/Install-Chocolatey.ps1 @@ -1,3 +1,8 @@ +################################################################################ +## File: Install-Chocolatey.ps1 +## Desc: Install Chocolatey package manager +################################################################################ + Write-Host "Set TLS1.2" [Net.ServicePointManager]::SecurityProtocol = [Net.ServicePointManager]::SecurityProtocol -bor "Tls12" diff --git a/images/windows/scripts/build/Install-ChocolateyPackages.ps1 b/images/windows/scripts/build/Install-ChocolateyPackages.ps1 new file mode 100644 index 000000000..3d2fbdc56 --- /dev/null +++ b/images/windows/scripts/build/Install-ChocolateyPackages.ps1 @@ -0,0 +1,12 @@ +################################################################################ +## File: Install-ChocolateyPackages.ps1 +## Desc: Install common Chocolatey packages +################################################################################ + +$commonPackages = (Get-ToolsetContent).choco.common_packages + +foreach ($package in $commonPackages) { + Choco-Install -PackageName $package.name -ArgumentList $package.args +} + +Invoke-PesterTests -TestFile "ChocoPackages" diff --git a/images/windows/scripts/build/Install-Chrome.ps1 b/images/windows/scripts/build/Install-Chrome.ps1 index 6ae1473e3..7ef364919 100644 --- a/images/windows/scripts/build/Install-Chrome.ps1 +++ b/images/windows/scripts/build/Install-Chrome.ps1 @@ -1,6 +1,6 @@ ################################################################################ ## File: Install-Chrome.ps1 -## Desc: Install Google Chrome +## Desc: Install Google Chrome browser and Chrome WebDriver ################################################################################ # Download and install latest Chrome browser diff --git a/images/windows/scripts/build/Install-CommonUtils.ps1 b/images/windows/scripts/build/Install-CommonUtils.ps1 deleted file mode 100644 index 815d04f3e..000000000 --- a/images/windows/scripts/build/Install-CommonUtils.ps1 +++ /dev/null @@ -1,8 +0,0 @@ -$commonPackages = (Get-ToolsetContent).choco.common_packages - -foreach ($package in $commonPackages) -{ - Choco-Install -PackageName $package.name -ArgumentList $package.args -} - -Invoke-PesterTests -TestFile "ChocoPackages" \ No newline at end of file diff --git a/images/windows/scripts/build/Install-Docker-Compose.ps1 b/images/windows/scripts/build/Install-DockerCompose.ps1 similarity index 100% rename from images/windows/scripts/build/Install-Docker-Compose.ps1 rename to images/windows/scripts/build/Install-DockerCompose.ps1 diff --git a/images/windows/scripts/build/Install-Docker-WinCred.ps1 b/images/windows/scripts/build/Install-DockerWinCred.ps1 similarity index 100% rename from images/windows/scripts/build/Install-Docker-WinCred.ps1 rename to images/windows/scripts/build/Install-DockerWinCred.ps1 diff --git a/images/windows/scripts/build/Install-DotnetSDK.ps1 b/images/windows/scripts/build/Install-DotnetSDK.ps1 index b1afdff46..b1f7abeaa 100644 --- a/images/windows/scripts/build/Install-DotnetSDK.ps1 +++ b/images/windows/scripts/build/Install-DotnetSDK.ps1 @@ -1,7 +1,7 @@ ################################################################################ ## File: Install-DotnetSDK.ps1 ## Desc: Install all released versions of the dotnet sdk and populate package -## cache. Should run after VS and Node +## cache. Should run after VS and Node ## Supply chain security: checksum validation ################################################################################ diff --git a/images/windows/scripts/build/Install-Edge.ps1 b/images/windows/scripts/build/Install-EdgeDriver.ps1 similarity index 94% rename from images/windows/scripts/build/Install-Edge.ps1 rename to images/windows/scripts/build/Install-EdgeDriver.ps1 index 57ba8940e..ff6af450d 100644 --- a/images/windows/scripts/build/Install-Edge.ps1 +++ b/images/windows/scripts/build/Install-EdgeDriver.ps1 @@ -1,6 +1,6 @@ ################################################################################ -## File: Install-Edge.ps1 -## Desc: Configure Edge browser and install Edge WebDriver +## File: Install-EdgeDriver.ps1 +## Desc: Install Edge WebDriver and configure Microsoft Edge ################################################################################ # Disable Edge auto-updates @@ -9,8 +9,7 @@ Rename-Item -Path "C:\Program Files (x86)\Microsoft\EdgeUpdate\MicrosoftEdgeUpda # Install Microsoft Edge WebDriver Write-Host "Install Edge WebDriver..." $EdgeDriverPath = "$($env:SystemDrive)\SeleniumWebDrivers\EdgeDriver" -if (-not (Test-Path -Path $EdgeDriverPath)) -{ +if (-not (Test-Path -Path $EdgeDriverPath)) { New-Item -Path $EdgeDriverPath -ItemType Directory -Force } diff --git a/images/windows/scripts/build/Install-Firefox.ps1 b/images/windows/scripts/build/Install-Firefox.ps1 index a100b239e..ea2332678 100644 --- a/images/windows/scripts/build/Install-Firefox.ps1 +++ b/images/windows/scripts/build/Install-Firefox.ps1 @@ -1,6 +1,6 @@ ################################################################################ ## File: Install-Firefox.ps1 -## Desc: Install Mozilla Firefox +## Desc: Install Mozilla Firefox browser and Gecko WebDriver ## Supply chain security: Firefox browser - checksum validation ################################################################################ diff --git a/images/windows/scripts/build/Run-NGen.ps1 b/images/windows/scripts/build/Install-NativeImages.ps1 similarity index 62% rename from images/windows/scripts/build/Run-NGen.ps1 rename to images/windows/scripts/build/Install-NativeImages.ps1 index 4ecddd3ca..7a11c4953 100644 --- a/images/windows/scripts/build/Run-NGen.ps1 +++ b/images/windows/scripts/build/Install-NativeImages.ps1 @@ -1,6 +1,11 @@ +################################################################################ +## File: Install-NativeImages.ps1 +## Desc: Generate and install native images for .NET assemblies +################################################################################ + Write-Host "NGen: Microsoft.PowerShell.Utility.Activities" $null = & $env:SystemRoot\Microsoft.NET\Framework64\v4.0.30319\ngen.exe install "Microsoft.PowerShell.Utility.Activities, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" Write-Host "NGen: Framework64" $null = & $env:SystemRoot\Microsoft.NET\Framework64\v4.0.30319\ngen.exe update Write-Host "NGen: Framework" -$null = & $env:SystemRoot\Microsoft.NET\Framework\v4.0.30319\ngen.exe update \ No newline at end of file +$null = & $env:SystemRoot\Microsoft.NET\Framework\v4.0.30319\ngen.exe update diff --git a/images/windows/scripts/build/Install-NodeLts.ps1 b/images/windows/scripts/build/Install-NodeJS.ps1 similarity index 97% rename from images/windows/scripts/build/Install-NodeLts.ps1 rename to images/windows/scripts/build/Install-NodeJS.ps1 index 18ba83b7d..37840ad31 100644 --- a/images/windows/scripts/build/Install-NodeLts.ps1 +++ b/images/windows/scripts/build/Install-NodeJS.ps1 @@ -1,5 +1,5 @@ ################################################################################ -## File: Install-NodeLts.ps1 +## File: Install-NodeJS.ps1 ## Desc: Install nodejs-lts and other common node tools. ## Must run after python is configured ################################################################################ diff --git a/images/windows/scripts/build/Install-Pipx.ps1 b/images/windows/scripts/build/Install-Pipx.ps1 index b3e85f4f2..e4babf990 100644 --- a/images/windows/scripts/build/Install-Pipx.ps1 +++ b/images/windows/scripts/build/Install-Pipx.ps1 @@ -1,14 +1,32 @@ -# Set custom directorys for pipx +################################################################################ +## File: Install-Pipx.ps1 +## Desc: Install pipx and pipx packages +################################################################################ + +Write-Host "Installing pipx..." $env:PIPX_BIN_DIR = "${env:ProgramFiles(x86)}\pipx_bin" $env:PIPX_HOME = "${env:ProgramFiles(x86)}\pipx" -# Install pipx pip install pipx -# Set environment variables Add-MachinePathItem "${env:PIPX_BIN_DIR}" Set-SystemVariable -SystemVariable PIPX_BIN_DIR -Value $env:PIPX_BIN_DIR Set-SystemVariable -SystemVariable PIPX_HOME -Value $env:PIPX_HOME -# Test pipx -Invoke-PesterTests -TestFile "Tools" -TestName "Pipx" \ No newline at end of file +Invoke-PesterTests -TestFile "Tools" -TestName "Pipx" + +Write-Host "Installing pipx packages..." + +$pipxToolset = (Get-ToolsetContent).pipx +foreach ($tool in $pipxToolset) { + if ($tool.python) { + $pythonPath = (Get-Item -Path "${env:AGENT_TOOLSDIRECTORY}\Python\${tool.python}.*\x64\python-${tool.python}*").FullName + Write-Host "Install ${tool.package} into python ${tool.python}" + pipx install $tool.package --python $pythonPath + } else { + Write-Host "Install ${tool.package} into default python" + pipx install $tool.package + } +} + +Invoke-PesterTests -TestFile "PipxPackages" diff --git a/images/windows/scripts/build/Install-PipxPackages.ps1 b/images/windows/scripts/build/Install-PipxPackages.ps1 deleted file mode 100644 index c4a48ec93..000000000 --- a/images/windows/scripts/build/Install-PipxPackages.ps1 +++ /dev/null @@ -1,12 +0,0 @@ -$pipxToolset = (Get-ToolsetContent).pipx -foreach($tool in $pipxToolset) { - if ($tool.python) { - $pythonPath = (Get-Item -Path "${env:AGENT_TOOLSDIRECTORY}\Python\${tool.python}.*\x64\python-${tool.python}*").FullName - Write-Host "Install ${tool.package} into python ${tool.python}" - pipx install $tool.package --python $pythonPath - } else { - Write-Host "Install ${tool.package} into default python" - pipx install $tool.package - } -} -Invoke-PesterTests -TestFile "PipxPackages" \ No newline at end of file diff --git a/images/windows/scripts/build/Install-PowerShellModules.ps1 b/images/windows/scripts/build/Install-PowerShellModules.ps1 index ec8b45e1c..130c63db6 100644 --- a/images/windows/scripts/build/Install-PowerShellModules.ps1 +++ b/images/windows/scripts/build/Install-PowerShellModules.ps1 @@ -1,3 +1,8 @@ +################################################################################ +## File: Install-PowershellModules.ps1 +## Desc: Install common PowerShell modules +################################################################################ + # Set TLS1.2 [Net.ServicePointManager]::SecurityProtocol = [Net.ServicePointManager]::SecurityProtocol -bor "Tls12" diff --git a/images/windows/scripts/build/Install-AzureModules.ps1 b/images/windows/scripts/build/Install-PowershellAzModules.ps1 similarity index 81% rename from images/windows/scripts/build/Install-AzureModules.ps1 rename to images/windows/scripts/build/Install-PowershellAzModules.ps1 index 183fcb7d3..d297cddf1 100644 --- a/images/windows/scripts/build/Install-AzureModules.ps1 +++ b/images/windows/scripts/build/Install-PowershellAzModules.ps1 @@ -1,13 +1,12 @@ ################################################################################ -## File: Install-AzureModules.ps1 -## Desc: PowerShell modules used by AzureFileCopy@4, AzureFileCopy@5, AzurePowerShell@4, AzurePowerShell@5 tasks +## File: Install-PowershellAzModules.ps1 +## Desc: Install PowerShell modules used by AzureFileCopy@4, AzureFileCopy@5, AzurePowerShell@4, AzurePowerShell@5 tasks ## Supply chain security: package manager ################################################################################ # The correct Modules need to be saved in C:\Modules $installPSModulePath = "C:\\Modules" -if (-not (Test-Path -LiteralPath $installPSModulePath)) -{ +if (-not (Test-Path -LiteralPath $installPSModulePath)) { Write-Host "Creating ${installPSModulePath} folder to store PowerShell Azure modules..." $null = New-Item -Path $installPSModulePath -ItemType Directory } @@ -17,28 +16,24 @@ $modules = (Get-ToolsetContent).azureModules $psModuleMachinePath = "" -foreach ($module in $modules) -{ +foreach ($module in $modules) { $moduleName = $module.name Write-Host "Installing ${moduleName} to the ${installPSModulePath} path..." - foreach ($version in $module.versions) - { + foreach ($version in $module.versions) { $modulePath = Join-Path -Path $installPSModulePath -ChildPath "${moduleName}_${version}" Write-Host " - $version [$modulePath]" Save-Module -Path $modulePath -Name $moduleName -RequiredVersion $version -Force -ErrorAction Stop } - foreach ($version in $module.zip_versions) - { + foreach ($version in $module.zip_versions) { $modulePath = Join-Path -Path $installPSModulePath -ChildPath "${moduleName}_${version}" Save-Module -Path $modulePath -Name $moduleName -RequiredVersion $version -Force -ErrorAction Stop Compress-Archive -Path $modulePath -DestinationPath "${modulePath}.zip" Remove-Item $modulePath -Recurse -Force } # Append default tool version to machine path - if ($null -ne $module.default) - { + if ($null -ne $module.default) { $defaultVersion = $module.default Write-Host "Use ${moduleName} ${defaultVersion} as default version..." @@ -50,4 +45,4 @@ foreach ($module in $modules) $psModuleMachinePath += $env:PSModulePath [Environment]::SetEnvironmentVariable("PSModulePath", $psModuleMachinePath, "Machine") -Invoke-PesterTests -TestFile "PowerShellAzModules" -TestName "AzureModules" \ No newline at end of file +Invoke-PesterTests -TestFile "PowerShellAzModules" -TestName "AzureModules" diff --git a/images/windows/scripts/build/Install-PyPy.ps1 b/images/windows/scripts/build/Install-PyPy.ps1 index 69e3c32c6..8fdf513e4 100644 --- a/images/windows/scripts/build/Install-PyPy.ps1 +++ b/images/windows/scripts/build/Install-PyPy.ps1 @@ -1,9 +1,9 @@ ################################################################################ ## File: Install-PyPy.ps1 -## Team: CI-Build ## Desc: Install PyPy ## Supply chain security: checksum validation ################################################################################ + function Install-PyPy { param( diff --git a/images/windows/scripts/build/Install-Ruby.ps1 b/images/windows/scripts/build/Install-Ruby.ps1 index 41f52c584..5396edf66 100644 --- a/images/windows/scripts/build/Install-Ruby.ps1 +++ b/images/windows/scripts/build/Install-Ruby.ps1 @@ -1,10 +1,9 @@ ################################################################################ ## File: Install-Ruby.ps1 -## Desc: Install rubyinstaller2 +## Desc: Install Ruby using the RubyInstaller2 package and set the default Ruby version ################################################################################ -function Get-RubyVersions -{ +function Get-RubyVersions { param ( [System.String] $Arch = "x64", [System.String] $Extension = "7z", @@ -12,24 +11,20 @@ function Get-RubyVersions ) $uri = "https://api.github.com/repos/oneclick/rubyinstaller2/releases?per_page=$ReleasesAmount" - try - { + try { $versionLists = @{} $assets = (Invoke-RestMethod -Uri $uri).Where{ -not $_.prerelease }.assets $7zArchives = $assets.Where{ $_.name.EndsWith("$Arch.$Extension") } $majorMinorGroups = $7zArchives | Group-Object { $_.name.Replace("rubyinstaller-", "").Substring(0, 3) } - foreach($majorMinorGroup in $majorMinorGroups) - { + foreach ($majorMinorGroup in $majorMinorGroups) { $group = $majorMinorGroup.Group - $sortVersions = $group | Sort-Object {[Version]$_.name.Replace("rubyinstaller-", "").Replace("-$Arch.$Extension","").Replace("-",".")} + $sortVersions = $group | Sort-Object { [Version]$_.name.Replace("rubyinstaller-", "").Replace("-$Arch.$Extension", "").Replace("-", ".") } $latestVersion = $sortVersions | Select-Object -Last 1 $versionLists[$majorMinorGroup.Name] = $latestVersion.browser_download_url } return $versionLists - } - catch - { + } catch { Write-Host "Unable to send request to the '$uri'. Error: '$_'" exit 1 } @@ -37,8 +32,7 @@ function Get-RubyVersions # Most of this logic is from # https://github.com/ruby/setup-ruby/blob/master/windows.js -function Install-Ruby -{ +function Install-Ruby { param( [String]$PackagePath, [String]$Architecture = "x64" @@ -46,8 +40,7 @@ function Install-Ruby # Create Ruby toolcache folder $rubyToolcachePath = Join-Path -Path $env:AGENT_TOOLSDIRECTORY -ChildPath "Ruby" - if (-not (Test-Path $rubyToolcachePath)) - { + if (-not (Test-Path $rubyToolcachePath)) { Write-Host "Creating Ruby toolcache folder" New-Item -ItemType Directory -Path $rubyToolcachePath | Out-Null } @@ -60,8 +53,7 @@ function Install-Ruby # Get Ruby version from binaries $rubyVersion = & "$tempFolder\bin\ruby.exe" -e "print RUBY_VERSION" - if ($rubyVersion) - { + if ($rubyVersion) { Write-Host "Installing Ruby $rubyVersion" $rubyVersionPath = Join-Path -Path $rubyToolcachePath -ChildPath $rubyVersion $rubyArchPath = Join-Path -Path $rubyVersionPath -ChildPath $Architecture @@ -79,18 +71,15 @@ function Install-Ruby Write-Host "Creating complete file" New-Item -ItemType File -Path $rubyVersionPath -Name "$Architecture.complete" | Out-Null - } - else - { + } else { Write-Host "Ruby application is not found. Failed to expand '$PackagePath' archive" exit 1 } } -function Set-DefaultRubyVersion -{ +function Set-DefaultRubyVersion { param( - [Parameter(Mandatory=$true)] + [Parameter(Mandatory = $true)] [System.Version] $Version, [System.String] $Arch = "x64" ) @@ -110,21 +99,17 @@ $rubyToolVersions = $rubyTools.versions $rubyLatestMajorVersions = Get-RubyVersions Write-Host "Starting installation Ruby..." -foreach($rubyVersion in $rubyToolVersions) -{ +foreach ($rubyVersion in $rubyToolVersions) { Write-Host "Starting Ruby $rubyVersion installation" # Get url for the latest major Ruby version $url = $rubyLatestMajorVersions[$rubyVersion] - if ($url) - { + if ($url) { $tempRubyPackagePath = Start-DownloadWithRetry -Url $url Install-Ruby -PackagePath $tempRubyPackagePath - } - else - { + } else { Write-Host "Url not found for the '$rubyVersion' version" exit 1 } } -Set-DefaultRubyVersion -Version $rubyTools.default -Arch $rubyTools.arch \ No newline at end of file +Set-DefaultRubyVersion -Version $rubyTools.default -Arch $rubyTools.arch diff --git a/images/windows/scripts/build/Install-SQLOLEDBDriver.ps1 b/images/windows/scripts/build/Install-SQLOLEDBDriver.ps1 index 503363b05..207c728c4 100644 --- a/images/windows/scripts/build/Install-SQLOLEDBDriver.ps1 +++ b/images/windows/scripts/build/Install-SQLOLEDBDriver.ps1 @@ -1,6 +1,6 @@ ################################################################################ ## File: Install-SQLOLEDBDriver.ps1 -## Desc: Install SQL OLEDB Driver +## Desc: Install OLE DB Driver for SQL Server ################################################################################ $binaryDownloadPath = Start-DownloadWithRetry "https://go.microsoft.com/fwlink/?linkid=2242656" "msoledbsql.msi" diff --git a/images/windows/scripts/build/Install-Vsix.ps1 b/images/windows/scripts/build/Install-VSExtensions.ps1 similarity index 92% rename from images/windows/scripts/build/Install-Vsix.ps1 rename to images/windows/scripts/build/Install-VSExtensions.ps1 index cf132ea89..0b18a7da8 100644 --- a/images/windows/scripts/build/Install-Vsix.ps1 +++ b/images/windows/scripts/build/Install-VSExtensions.ps1 @@ -1,5 +1,5 @@ ################################################################################### -## File: Install-Vsix.ps1 +## File: Install-VSExtensions.ps1 ## Desc: Install the Visual Studio Extensions from toolset.json ################################################################################### @@ -21,4 +21,4 @@ $vsixPackagesList | ForEach-Object { } } -Invoke-PesterTests -TestFile "Vsix" \ No newline at end of file +Invoke-PesterTests -TestFile "Vsix" diff --git a/images/windows/scripts/build/Install-VS.ps1 b/images/windows/scripts/build/Install-VisualStudio.ps1 similarity index 83% rename from images/windows/scripts/build/Install-VS.ps1 rename to images/windows/scripts/build/Install-VisualStudio.ps1 index b9865294e..8b0fbb791 100644 --- a/images/windows/scripts/build/Install-VS.ps1 +++ b/images/windows/scripts/build/Install-VisualStudio.ps1 @@ -1,5 +1,5 @@ ################################################################################ -## File: Install-VS.ps1 +## File: Install-VisualStudio.ps1 ## Desc: Install Visual Studio ################################################################################ @@ -19,8 +19,7 @@ Install-VisualStudio ` $vsProgramData = Get-Item -Path "C:\ProgramData\Microsoft\VisualStudio\Packages\_Instances" $instanceFolders = Get-ChildItem -Path $vsProgramData.FullName -if ($instanceFolders -is [array]) -{ +if ($instanceFolders -is [array]) { Write-Host "More than one instance installed" exit 1 } @@ -32,14 +31,14 @@ Set-Content -Path "$vsInstallRoot\Common7\IDE\Extensions\MachineState.json" -Val if (Test-IsWin19) { - # Install Windows 10 SDK version 10.0.14393.795 + # Install Windows 10 SDK version 10.0.14393.795 $sdkSignatureThumbprint = "C91545B333C52C4465DE8B90A3FAF4E1D9C58DFA" - $sdkUrl = "https://go.microsoft.com/fwlink/p/?LinkId=838916" - $sdkFileName = "sdksetup14393.exe" - $argumentList = ("/q", "/norestart", "/ceip off", "/features OptionId.WindowsSoftwareDevelopmentKit") - Install-Binary -Url $sdkUrl -Name $sdkFileName -ArgumentList $argumentList -ExpectedSignature $sdkSignatureThumbprint + $sdkUrl = "https://go.microsoft.com/fwlink/p/?LinkId=838916" + $sdkFileName = "sdksetup14393.exe" + $argumentList = ("/q", "/norestart", "/ceip off", "/features OptionId.WindowsSoftwareDevelopmentKit") + Install-Binary -Url $sdkUrl -Name $sdkFileName -ArgumentList $argumentList -ExpectedSignature $sdkSignatureThumbprint - # Install Windows 11 SDK version 10.0.22621.0 + # Install Windows 11 SDK version 10.0.22621.0 $sdkSignatureThumbprint = "E4C5C5FCDB68B930EE4E19BC25D431EF6D864C51" $sdkUrl = "https://go.microsoft.com/fwlink/p/?linkid=2196241" $sdkFileName = "sdksetup22621.exe" diff --git a/images/windows/scripts/build/Wait-WindowsUpdatesForInstall.ps1 b/images/windows/scripts/build/Install-WindowsUpdatesAfterReboot.ps1 similarity index 80% rename from images/windows/scripts/build/Wait-WindowsUpdatesForInstall.ps1 rename to images/windows/scripts/build/Install-WindowsUpdatesAfterReboot.ps1 index 912f884c9..4d782299b 100644 --- a/images/windows/scripts/build/Wait-WindowsUpdatesForInstall.ps1 +++ b/images/windows/scripts/build/Install-WindowsUpdatesAfterReboot.ps1 @@ -1,6 +1,6 @@ ################################################################################ -## File: Wait-WindowsUpdatesForInstall.ps1 -## Desc: Wait for installation windows updates to complete +## File: Install-WindowsUpdatesAfterReboot.ps1 +## Desc: Waits for Windows Updates to finish installing after reboot ################################################################################ Invoke-SBWithRetry -RetryCount 10 -RetryIntervalSeconds 120 -Command { diff --git a/images/windows/scripts/build/Install-Zstd.ps1 b/images/windows/scripts/build/Install-Zstd.ps1 index 0dd403c02..d0481ef55 100644 --- a/images/windows/scripts/build/Install-Zstd.ps1 +++ b/images/windows/scripts/build/Install-Zstd.ps1 @@ -1,5 +1,5 @@ ################################################################################ -## File: Install-zstd.ps1 +## File: Install-Zstd.ps1 ## Desc: Install zstd ################################################################################ diff --git a/images/windows/scripts/docs-gen/SoftwareReport.Generator.ps1 b/images/windows/scripts/docs-gen/Generate-SoftwareReport.ps1 similarity index 100% rename from images/windows/scripts/docs-gen/SoftwareReport.Generator.ps1 rename to images/windows/scripts/docs-gen/Generate-SoftwareReport.ps1 diff --git a/images/windows/scripts/helpers/ImageHelpers.psm1 b/images/windows/scripts/helpers/ImageHelpers.psm1 index 76c31bb1f..ec7959cc7 100644 --- a/images/windows/scripts/helpers/ImageHelpers.psm1 +++ b/images/windows/scripts/helpers/ImageHelpers.psm1 @@ -4,7 +4,6 @@ param() . $PSScriptRoot\PathHelpers.ps1 . $PSScriptRoot\InstallHelpers.ps1 . $PSScriptRoot\ChocoHelpers.ps1 -. $PSScriptRoot\TestsHelpers.ps1 . $PSScriptRoot\VisualStudioHelpers.ps1 Export-ModuleMember -Function @( @@ -26,6 +25,7 @@ Export-ModuleMember -Function @( 'Install-VisualStudio' 'Get-ToolsetContent' 'Get-ToolsetToolFullPath' + 'Get-ToolcacheToolDirectory' 'Stop-SvcWithErrHandling' 'Set-SvcWithErrHandling' 'Start-DownloadWithRetry' @@ -40,10 +40,6 @@ Export-ModuleMember -Function @( 'Get-LatestChocoPackageVersion' 'Get-GitHubPackageDownloadUrl' 'Extract-7Zip' - 'Get-CommandResult' - 'Get-WhichTool' - 'Get-EnvironmentVariable' - 'Invoke-PesterTests' 'Invoke-SBWithRetry' 'Get-VsCatalogJsonPath' 'Install-AndroidSDKPackages' @@ -54,7 +50,6 @@ Export-ModuleMember -Function @( 'Get-VisualStudioComponents' 'Get-WindowsUpdatesHistory' 'New-ItemPath' - 'Get-ModuleVersionAsJob' 'Use-ChecksumComparison' 'Get-HashFromGitHubReleaseBody' 'Test-FileSignature' diff --git a/images/windows/scripts/helpers/TestsHelpers.ps1 b/images/windows/scripts/tests/Helpers.psm1 similarity index 94% rename from images/windows/scripts/helpers/TestsHelpers.ps1 rename to images/windows/scripts/tests/Helpers.psm1 index f22cd9c22..420d86a02 100644 --- a/images/windows/scripts/helpers/TestsHelpers.ps1 +++ b/images/windows/scripts/tests/Helpers.psm1 @@ -1,3 +1,6 @@ +[CmdletBinding()] +param() + function Get-CommandResult { Param ( [Parameter(Mandatory)][string] $Command @@ -7,7 +10,7 @@ function Get-CommandResult { $exitCode = $LASTEXITCODE return @{ - Output = $output + Output = $output ExitCode = $exitCode } } @@ -87,8 +90,7 @@ function ShouldReturnZeroExitCode { [bool]$succeeded = $result.ExitCode -eq 0 if ($Negate) { $succeeded = -not $succeeded } - if (-not $succeeded) - { + if (-not $succeeded) { $commandOutputIndent = " " * 4 $commandOutput = ($result.Output | ForEach-Object { "${commandOutputIndent}${_}" }) -join "`n" $failureMessage = "Command '${ActualValue}' has finished with exit code ${actualExitCode}`n${commandOutput}" @@ -111,22 +113,19 @@ function ShouldReturnZeroExitCodeWithParam { $delimiterCharacter = "" - while ($delimiterCharacter.Length -le 2) - { + while ($delimiterCharacter.Length -le 2) { $callParameterWithDelimiter = $delimiterCharacter + $CallParameter $commandToCheck = "$ActualValue $callParameterWithDelimiter" [bool]$succeeded = (ShouldReturnZeroExitCode -ActualValue $commandToCheck).Succeeded - if ($succeeded) - { + if ($succeeded) { break } $delimiterCharacter += '-' } if ($Negate) { $succeeded = -not $succeeded } - if (-not $succeeded) - { + if (-not $succeeded) { $failureMessage = "Tool '$ActualValue' has not returned 0 exit code for any of these flags: '$CallParameter' or '-$CallParameter' or '--$CallParameter'" } @@ -156,8 +155,7 @@ function ShouldMatchCommandOutput { if (-not $succeeded) { if ($Negate) { $failureMessage = "Expected regular expression '$RegularExpression' for '$ActualValue' command to not match '$output', but it did match." - } - else { + } else { $failureMessage = "Expected regular expression '$RegularExpression' for '$ActualValue' command to match '$output', but it did not match." } } @@ -198,3 +196,12 @@ Function Get-ModuleVersionAsJob { $testJob | Wait-Job | Receive-Job | Out-File -FilePath "${env:TEMP}\module-version.txt" Remove-Job $testJob } + + +Export-ModuleMember -Function @( + 'Get-CommandResult' + 'Get-WhichTool' + 'Get-EnvironmentVariable' + 'Invoke-PesterTests' + 'Get-ModuleVersionAsJob' +) diff --git a/images/windows/templates/windows-2019.json b/images/windows/templates/windows-2019.json index ce5566b0c..7dcd0335e 100644 --- a/images/windows/templates/windows-2019.json +++ b/images/windows/templates/windows-2019.json @@ -92,6 +92,8 @@ "Remove-Item -Recurse '{{user `image_folder`}}\\assets'", "Move-Item '{{user `image_folder`}}\\scripts\\docs-gen' '{{user `image_folder`}}\\SoftwareReport'", "Move-Item '{{user `image_folder`}}\\scripts\\helpers' '{{user `helper_script_folder`}}\\ImageHelpers'", + "New-Item -Type Directory -Path '{{user `helper_script_folder`}}\\TestsHelpers\\'", + "Move-Item '{{user `image_folder`}}\\scripts\\tests\\Helpers.psm1' '{{user `helper_script_folder`}}\\TestsHelpers\\TestsHelpers.psm1'", "Move-Item '{{user `image_folder`}}\\scripts\\tests' '{{user `image_folder`}}\\tests'", "Remove-Item -Recurse '{{user `image_folder`}}\\scripts'", "Move-Item '{{user `image_folder`}}\\toolsets\\toolset-2019.json' '{{user `image_folder`}}\\toolset.json'", @@ -147,14 +149,15 @@ "IMAGEDATA_FILE={{user `imagedata_file`}}" ], "scripts": [ - "{{ template_dir }}/../scripts/build/Configure-Antivirus.ps1", + "{{ template_dir }}/../scripts/build/Configure-WindowsDefender.ps1", "{{ template_dir }}/../scripts/build/Configure-PowerShell.ps1", - "{{ template_dir }}/../scripts/build/Install-PowerShellModules.ps1", + "{{ template_dir }}/../scripts/build/Install-PowershellModules.ps1", "{{ template_dir }}/../scripts/build/Install-WindowsFeatures.ps1", - "{{ template_dir }}/../scripts/build/Install-Choco.ps1", - "{{ template_dir }}/../scripts/build/Initialize-VM.ps1", - "{{ template_dir }}/../scripts/build/Update-ImageData.ps1", - "{{ template_dir }}/../scripts/build/Update-DotnetTLS.ps1" + "{{ template_dir }}/../scripts/build/Install-Chocolatey.ps1", + "{{ template_dir }}/../scripts/build/Configure-BaseImage.ps1", + "{{ template_dir }}/../scripts/build/Configure-ImageDataFile.ps1", + "{{ template_dir }}/../scripts/build/Configure-SystemEnvironment.ps1", + "{{ template_dir }}/../scripts/build/Configure-DotnetSecureChannel.ps1" ], "execution_policy": "unrestricted" }, @@ -167,8 +170,8 @@ "scripts": [ "{{ template_dir }}/../scripts/build/Install-VCRedist.ps1", "{{ template_dir }}/../scripts/build/Install-Docker.ps1", - "{{ template_dir }}/../scripts/build/Install-Docker-WinCred.ps1", - "{{ template_dir }}/../scripts/build/Install-Docker-Compose.ps1", + "{{ template_dir }}/../scripts/build/Install-DockerWinCred.ps1", + "{{ template_dir }}/../scripts/build/Install-DockerCompose.ps1", "{{ template_dir }}/../scripts/build/Install-PowershellCore.ps1", "{{ template_dir }}/../scripts/build/Install-WebPlatformInstaller.ps1", "{{ template_dir }}/../scripts/build/Install-Runner.ps1" @@ -185,7 +188,7 @@ 3010 ], "scripts": [ - "{{ template_dir }}/../scripts/build/Install-VS.ps1", + "{{ template_dir }}/../scripts/build/Install-VisualStudio.ps1", "{{ template_dir }}/../scripts/build/Install-KubernetesTools.ps1", "{{ template_dir }}/../scripts/build/Install-NET48-devpack.ps1" ], @@ -197,10 +200,10 @@ "scripts": [ "{{ template_dir }}/../scripts/build/Install-Wix.ps1", "{{ template_dir }}/../scripts/build/Install-WDK.ps1", - "{{ template_dir }}/../scripts/build/Install-Vsix.ps1", + "{{ template_dir }}/../scripts/build/Install-VSExtensions.ps1", "{{ template_dir }}/../scripts/build/Install-AzureCli.ps1", "{{ template_dir }}/../scripts/build/Install-AzureDevOpsCli.ps1", - "{{ template_dir }}/../scripts/build/Install-CommonUtils.ps1", + "{{ template_dir }}/../scripts/build/Install-ChocolateyPackages.ps1", "{{ template_dir }}/../scripts/build/Install-JavaTools.ps1", "{{ template_dir }}/../scripts/build/Install-Kotlin.ps1", "{{ template_dir }}/../scripts/build/Install-OpenSSL.ps1" @@ -226,23 +229,22 @@ { "type": "powershell", "scripts": [ - "{{ template_dir }}/../scripts/build/Install-ActionArchiveCache.ps1", + "{{ template_dir }}/../scripts/build/Install-ActionsCache.ps1", "{{ template_dir }}/../scripts/build/Install-Ruby.ps1", "{{ template_dir }}/../scripts/build/Install-PyPy.ps1", "{{ template_dir }}/../scripts/build/Install-Toolset.ps1", "{{ template_dir }}/../scripts/build/Configure-Toolset.ps1", - "{{ template_dir }}/../scripts/build/Install-NodeLts.ps1", + "{{ template_dir }}/../scripts/build/Install-NodeJS.ps1", "{{ template_dir }}/../scripts/build/Install-AndroidSDK.ps1", - "{{ template_dir }}/../scripts/build/Install-AzureModules.ps1", + "{{ template_dir }}/../scripts/build/Install-PowershellAzModules.ps1", "{{ template_dir }}/../scripts/build/Install-Pipx.ps1", - "{{ template_dir }}/../scripts/build/Install-PipxPackages.ps1", "{{ template_dir }}/../scripts/build/Install-Git.ps1", "{{ template_dir }}/../scripts/build/Install-GitHub-CLI.ps1", "{{ template_dir }}/../scripts/build/Install-PHP.ps1", "{{ template_dir }}/../scripts/build/Install-Rust.ps1", "{{ template_dir }}/../scripts/build/Install-Sbt.ps1", "{{ template_dir }}/../scripts/build/Install-Chrome.ps1", - "{{ template_dir }}/../scripts/build/Install-Edge.ps1", + "{{ template_dir }}/../scripts/build/Install-EdgeDriver.ps1", "{{ template_dir }}/../scripts/build/Install-Firefox.ps1", "{{ template_dir }}/../scripts/build/Install-Selenium.ps1", "{{ template_dir }}/../scripts/build/Install-IEWebDriver.ps1", @@ -251,7 +253,7 @@ "{{ template_dir }}/../scripts/build/Install-Msys2.ps1", "{{ template_dir }}/../scripts/build/Install-WinAppDriver.ps1", "{{ template_dir }}/../scripts/build/Install-R.ps1", - "{{ template_dir }}/../scripts/build/Install-AWS.ps1", + "{{ template_dir }}/../scripts/build/Install-AWSTools.ps1", "{{ template_dir }}/../scripts/build/Install-DACFx.ps1", "{{ template_dir }}/../scripts/build/Install-MysqlCli.ps1", "{{ template_dir }}/../scripts/build/Install-SQLPowerShellTools.ps1", @@ -275,11 +277,11 @@ "{{ template_dir }}/../scripts/build/Install-GoogleCloudCLI.ps1", "{{ template_dir }}/../scripts/build/Install-CodeQLBundle.ps1", "{{ template_dir }}/../scripts/build/Install-BizTalkBuildComponent.ps1", - "{{ template_dir }}/../scripts/build/Disable-JITDebugger.ps1", + "{{ template_dir }}/../scripts/build/Configure-Diagnostics.ps1", "{{ template_dir }}/../scripts/build/Configure-DynamicPort.ps1", "{{ template_dir }}/../scripts/build/Configure-GDIProcessHandleQuota.ps1", "{{ template_dir }}/../scripts/build/Configure-Shell.ps1", - "{{ template_dir }}/../scripts/build/Enable-DeveloperMode.ps1", + "{{ template_dir }}/../scripts/build/Configure-DeveloperMode.ps1", "{{ template_dir }}/../scripts/build/Install-LLVM.ps1" ] }, @@ -301,7 +303,7 @@ "type": "powershell", "pause_before": "2m", "scripts": [ - "{{ template_dir }}/../scripts/build/Wait-WindowsUpdatesForInstall.ps1", + "{{ template_dir }}/../scripts/build/Install-WindowsUpdatesAfterReboot.ps1", "{{ template_dir }}/../scripts/tests/RunAll-Tests.ps1" ] }, @@ -314,7 +316,7 @@ { "type": "powershell", "inline": [ - "pwsh -File '{{user `image_folder`}}\\SoftwareReport\\SoftwareReport.Generator.ps1'" + "pwsh -File '{{user `image_folder`}}\\SoftwareReport\\Generate-SoftwareReport.ps1'" ], "environment_vars": [ "IMAGE_VERSION={{user `image_version`}}" @@ -343,9 +345,9 @@ "type": "powershell", "skip_clean": true, "scripts": [ - "{{ template_dir }}/../scripts/build/Run-NGen.ps1", - "{{ template_dir }}/../scripts/build/Finalize-VM.ps1", - "{{ template_dir }}/../scripts/build/Warmup-User.ps1" + "{{ template_dir }}/../scripts/build/Install-NativeImages.ps1", + "{{ template_dir }}/../scripts/build/Configure-System.ps1", + "{{ template_dir }}/../scripts/build/Configure-User.ps1" ], "environment_vars": [ "INSTALL_USER={{user `install_user`}}" diff --git a/images/windows/templates/windows-2022.json b/images/windows/templates/windows-2022.json index bfa4de3d3..871d6aac9 100644 --- a/images/windows/templates/windows-2022.json +++ b/images/windows/templates/windows-2022.json @@ -92,6 +92,8 @@ "Remove-Item -Recurse '{{user `image_folder`}}\\assets'", "Move-Item '{{user `image_folder`}}\\scripts\\docs-gen' '{{user `image_folder`}}\\SoftwareReport'", "Move-Item '{{user `image_folder`}}\\scripts\\helpers' '{{user `helper_script_folder`}}\\ImageHelpers'", + "New-Item -Type Directory -Path '{{user `helper_script_folder`}}\\TestsHelpers\\'", + "Move-Item '{{user `image_folder`}}\\scripts\\tests\\Helpers.psm1' '{{user `helper_script_folder`}}\\TestsHelpers\\TestsHelpers.psm1'", "Move-Item '{{user `image_folder`}}\\scripts\\tests' '{{user `image_folder`}}\\tests'", "Remove-Item -Recurse '{{user `image_folder`}}\\scripts'", "Move-Item '{{user `image_folder`}}\\toolsets\\toolset-2022.json' '{{user `image_folder`}}\\toolset.json'", @@ -131,14 +133,15 @@ "IMAGEDATA_FILE={{user `imagedata_file`}}" ], "scripts": [ - "{{ template_dir }}/../scripts/build/Configure-Antivirus.ps1", + "{{ template_dir }}/../scripts/build/Configure-WindowsDefender.ps1", "{{ template_dir }}/../scripts/build/Configure-PowerShell.ps1", - "{{ template_dir }}/../scripts/build/Install-PowerShellModules.ps1", + "{{ template_dir }}/../scripts/build/Install-PowershellModules.ps1", "{{ template_dir }}/../scripts/build/Install-WindowsFeatures.ps1", - "{{ template_dir }}/../scripts/build/Install-Choco.ps1", - "{{ template_dir }}/../scripts/build/Initialize-VM.ps1", - "{{ template_dir }}/../scripts/build/Update-ImageData.ps1", - "{{ template_dir }}/../scripts/build/Update-DotnetTLS.ps1" + "{{ template_dir }}/../scripts/build/Install-Chocolatey.ps1", + "{{ template_dir }}/../scripts/build/Configure-BaseImage.ps1", + "{{ template_dir }}/../scripts/build/Configure-ImageDataFile.ps1", + "{{ template_dir }}/../scripts/build/Configure-SystemEnvironment.ps1", + "{{ template_dir }}/../scripts/build/Configure-DotnetSecureChannel.ps1" ], "execution_policy": "unrestricted" }, @@ -152,8 +155,8 @@ "type": "powershell", "scripts": [ "{{ template_dir }}/../scripts/build/Install-Docker.ps1", - "{{ template_dir }}/../scripts/build/Install-Docker-WinCred.ps1", - "{{ template_dir }}/../scripts/build/Install-Docker-Compose.ps1", + "{{ template_dir }}/../scripts/build/Install-DockerWinCred.ps1", + "{{ template_dir }}/../scripts/build/Install-DockerCompose.ps1", "{{ template_dir }}/../scripts/build/Install-PowershellCore.ps1", "{{ template_dir }}/../scripts/build/Install-WebPlatformInstaller.ps1", "{{ template_dir }}/../scripts/build/Install-Runner.ps1" @@ -170,7 +173,7 @@ 3010 ], "scripts": [ - "{{ template_dir }}/../scripts/build/Install-VS.ps1", + "{{ template_dir }}/../scripts/build/Install-VisualStudio.ps1", "{{ template_dir }}/../scripts/build/Install-KubernetesTools.ps1" ], "elevated_user": "{{user `install_user`}}", @@ -187,10 +190,10 @@ "scripts": [ "{{ template_dir }}/../scripts/build/Install-Wix.ps1", "{{ template_dir }}/../scripts/build/Install-WDK.ps1", - "{{ template_dir }}/../scripts/build/Install-Vsix.ps1", + "{{ template_dir }}/../scripts/build/Install-VSExtensions.ps1", "{{ template_dir }}/../scripts/build/Install-AzureCli.ps1", "{{ template_dir }}/../scripts/build/Install-AzureDevOpsCli.ps1", - "{{ template_dir }}/../scripts/build/Install-CommonUtils.ps1", + "{{ template_dir }}/../scripts/build/Install-ChocolateyPackages.ps1", "{{ template_dir }}/../scripts/build/Install-JavaTools.ps1", "{{ template_dir }}/../scripts/build/Install-Kotlin.ps1", "{{ template_dir }}/../scripts/build/Install-OpenSSL.ps1" @@ -216,23 +219,22 @@ { "type": "powershell", "scripts": [ - "{{ template_dir }}/../scripts/build/Install-ActionArchiveCache.ps1", + "{{ template_dir }}/../scripts/build/Install-ActionsCache.ps1", "{{ template_dir }}/../scripts/build/Install-Ruby.ps1", "{{ template_dir }}/../scripts/build/Install-PyPy.ps1", "{{ template_dir }}/../scripts/build/Install-Toolset.ps1", "{{ template_dir }}/../scripts/build/Configure-Toolset.ps1", - "{{ template_dir }}/../scripts/build/Install-NodeLts.ps1", + "{{ template_dir }}/../scripts/build/Install-NodeJS.ps1", "{{ template_dir }}/../scripts/build/Install-AndroidSDK.ps1", - "{{ template_dir }}/../scripts/build/Install-AzureModules.ps1", + "{{ template_dir }}/../scripts/build/Install-PowershellAzModules.ps1", "{{ template_dir }}/../scripts/build/Install-Pipx.ps1", - "{{ template_dir }}/../scripts/build/Install-PipxPackages.ps1", "{{ template_dir }}/../scripts/build/Install-Git.ps1", "{{ template_dir }}/../scripts/build/Install-GitHub-CLI.ps1", "{{ template_dir }}/../scripts/build/Install-PHP.ps1", "{{ template_dir }}/../scripts/build/Install-Rust.ps1", "{{ template_dir }}/../scripts/build/Install-Sbt.ps1", "{{ template_dir }}/../scripts/build/Install-Chrome.ps1", - "{{ template_dir }}/../scripts/build/Install-Edge.ps1", + "{{ template_dir }}/../scripts/build/Install-EdgeDriver.ps1", "{{ template_dir }}/../scripts/build/Install-Firefox.ps1", "{{ template_dir }}/../scripts/build/Install-Selenium.ps1", "{{ template_dir }}/../scripts/build/Install-IEWebDriver.ps1", @@ -241,7 +243,7 @@ "{{ template_dir }}/../scripts/build/Install-Msys2.ps1", "{{ template_dir }}/../scripts/build/Install-WinAppDriver.ps1", "{{ template_dir }}/../scripts/build/Install-R.ps1", - "{{ template_dir }}/../scripts/build/Install-AWS.ps1", + "{{ template_dir }}/../scripts/build/Install-AWSTools.ps1", "{{ template_dir }}/../scripts/build/Install-DACFx.ps1", "{{ template_dir }}/../scripts/build/Install-MysqlCli.ps1", "{{ template_dir }}/../scripts/build/Install-SQLPowerShellTools.ps1", @@ -262,7 +264,7 @@ "{{ template_dir }}/../scripts/build/Install-RootCA.ps1", "{{ template_dir }}/../scripts/build/Install-MongoDB.ps1", "{{ template_dir }}/../scripts/build/Install-CodeQLBundle.ps1", - "{{ template_dir }}/../scripts/build/Disable-JITDebugger.ps1" + "{{ template_dir }}/../scripts/build/Configure-Diagnostics.ps1" ] }, { @@ -272,7 +274,7 @@ "{{ template_dir }}/../scripts/build/Configure-DynamicPort.ps1", "{{ template_dir }}/../scripts/build/Configure-GDIProcessHandleQuota.ps1", "{{ template_dir }}/../scripts/build/Configure-Shell.ps1", - "{{ template_dir }}/../scripts/build/Enable-DeveloperMode.ps1", + "{{ template_dir }}/../scripts/build/Configure-DeveloperMode.ps1", "{{ template_dir }}/../scripts/build/Install-LLVM.ps1" ], "elevated_user": "{{user `install_user`}}", @@ -288,7 +290,7 @@ "type": "powershell", "pause_before": "2m", "scripts": [ - "{{ template_dir }}/../scripts/build/Wait-WindowsUpdatesForInstall.ps1", + "{{ template_dir }}/../scripts/build/Install-WindowsUpdatesAfterReboot.ps1", "{{ template_dir }}/../scripts/tests/RunAll-Tests.ps1" ] }, @@ -301,7 +303,7 @@ { "type": "powershell", "inline": [ - "pwsh -File '{{user `image_folder`}}\\SoftwareReport\\SoftwareReport.Generator.ps1'" + "pwsh -File '{{user `image_folder`}}\\SoftwareReport\\Generate-SoftwareReport.ps1'" ], "environment_vars": [ "IMAGE_VERSION={{user `image_version`}}" @@ -330,9 +332,9 @@ "type": "powershell", "skip_clean": true, "scripts": [ - "{{ template_dir }}/../scripts/build/Run-NGen.ps1", - "{{ template_dir }}/../scripts/build/Finalize-VM.ps1", - "{{ template_dir }}/../scripts/build/Warmup-User.ps1" + "{{ template_dir }}/../scripts/build/Install-NativeImages.ps1", + "{{ template_dir }}/../scripts/build/Configure-System.ps1", + "{{ template_dir }}/../scripts/build/Configure-User.ps1" ], "environment_vars": [ "INSTALL_USER={{user `install_user`}}"