[Windows] Add Windows 2025 code (#11037)

This commit is contained in:
Alexey-Ayupov
2024-11-29 11:08:29 +01:00
committed by GitHub
parent 6c768837be
commit e3ba729b37
25 changed files with 993 additions and 80 deletions

View File

@@ -15,7 +15,11 @@ $imageMinorVersion = $imageVersionComponents[1]
$imageDataFile = $env:IMAGEDATA_FILE
$githubUrl = "https://github.com/actions/runner-images/blob"
if (Test-IsWin22) {
if (Test-IsWin25) {
$imageLabel = "windows-2025"
$softwareUrl = "${githubUrl}/win25/$imageMajorVersion.$imageMinorVersion/images/windows/Windows2025-Readme.md"
$releaseUrl = "https://github.com/actions/runner-images/releases/tag/win25%2F$imageMajorVersion.$imageMinorVersion"
} elseif (Test-IsWin22) {
$imageLabel = "windows-2022"
$softwareUrl = "${githubUrl}/win22/$imageMajorVersion.$imageMinorVersion/images/windows/Windows2022-Readme.md"
$releaseUrl = "https://github.com/actions/runner-images/releases/tag/win22%2F$imageMajorVersion.$imageMinorVersion"

View File

@@ -27,18 +27,26 @@ if ($LASTEXITCODE -ne 0) {
throw "Failed to copy HKCU\Software\Microsoft\VisualStudio to HKLM\DEFAULT\Software\Microsoft\VisualStudio"
}
# disable TSVNCache.exe
$registryKeyPath = 'HKCU:\Software\TortoiseSVN'
if (-not(Test-Path -Path $registryKeyPath)) {
New-Item -Path $registryKeyPath -ItemType Directory -Force
}
# TortoiseSVN not installed on Windows 2025 image due to Sysprep issues
if (-not (Test-IsWin25)) {
# disable TSVNCache.exe
$registryKeyPath = 'HKCU:\Software\TortoiseSVN'
if (-not(Test-Path -Path $registryKeyPath)) {
New-Item -Path $registryKeyPath -ItemType Directory -Force
}
New-ItemProperty -Path $registryKeyPath -Name CacheType -PropertyType DWORD -Value 0
reg.exe copy HKCU\Software\TortoiseSVN HKLM\DEFAULT\Software\TortoiseSVN /s
if ($LASTEXITCODE -ne 0) {
throw "Failed to copy HKCU\Software\TortoiseSVN to HKLM\DEFAULT\Software\TortoiseSVN"
New-ItemProperty -Path $registryKeyPath -Name CacheType -PropertyType DWORD -Value 0
reg.exe copy HKCU\Software\TortoiseSVN HKLM\DEFAULT\Software\TortoiseSVN /s
if ($LASTEXITCODE -ne 0) {
throw "Failed to copy HKCU\Software\TortoiseSVN to HKLM\DEFAULT\Software\TortoiseSVN"
}
}
Dismount-RegistryHive "HKLM\DEFAULT"
# Remove the "installer" (var.install_user) user profile for Windows 2025 image
if (Test-IsWin25) {
Get-CimInstance -ClassName Win32_UserProfile | where-object {$_.LocalPath -match $env:INSTALL_USER} | Remove-CimInstance -Confirm:$false
& net user $env:INSTALL_USER /DELETE
}
Write-Host "Configure-User.ps1 - completed"

View File

@@ -41,16 +41,18 @@ if ($LastExitCode -ne 0) {
# https://github.com/Azure/azure-cli/issues/18766
New-Item -ItemType SymbolicLink -Path "C:\Windows\SysWOW64\docker.exe" -Target "C:\Windows\System32\docker.exe"
Write-Host "Download docker images"
$dockerImages = (Get-ToolsetContent).docker.images
foreach ($dockerImage in $dockerImages) {
Write-Host "Pulling docker image $dockerImage ..."
docker pull $dockerImage
if (-not (Test-IsWin25)) {
Write-Host "Download docker images"
$dockerImages = (Get-ToolsetContent).docker.images
foreach ($dockerImage in $dockerImages) {
Write-Host "Pulling docker image $dockerImage ..."
docker pull $dockerImage
if (!$?) {
throw "Docker pull failed with a non-zero exit code ($LastExitCode)"
if (!$?) {
throw "Docker pull failed with a non-zero exit code ($LastExitCode)"
}
}
Invoke-PesterTests -TestFile "Docker" -TestName "DockerImages"
}
Invoke-PesterTests -TestFile "Docker" -TestName "Docker"
Invoke-PesterTests -TestFile "Docker" -TestName "DockerImages"

View File

@@ -29,10 +29,15 @@ Add-MachinePathItem "$ghcupPrefix\ghcup\bin"
Add-MachinePathItem "$cabalDir\bin"
Update-Environment
# Get 3 latest versions of GHC
# Get 1 or 3 latest versions of GHC depending on the OS version
If (Test-IsWin25) {
$numberOfVersions = 1
} else {
$numberOfVersions = 3
}
$versions = ghcup list -t ghc -r | Where-Object { $_ -notlike "prerelease" }
$versionsOutput = [version[]]($versions | ForEach-Object { $_.Split(' ')[1]; })
$latestMajorMinor = $versionsOutput | Group-Object { $_.ToString(2) } | Sort-Object { [Version] $_.Name } | Select-Object -last 3
$latestMajorMinor = $versionsOutput | Group-Object { $_.ToString(2) } | Sort-Object { [Version] $_.Name } | Select-Object -last $numberOfVersions
$versionsList = $latestMajorMinor | ForEach-Object { $_.Group | Select-Object -Last 1 } | Sort-Object
# The latest version will be installed as a default

View File

@@ -27,13 +27,13 @@ if (Test-IsWin19) {
$path = "C:\$_\bin\mingw32-make.exe" | Get-Item
Copy-Item -Path $path -Destination (Join-Path $path.Directory 'make.exe')
}
Add-MachinePathItem "C:\mingw64\bin"
}
if (Test-IsWin22) {
# If Windows 2022, install version specified in the toolset
if (-not (Test-IsWin19)) {
# If Windows 2022 0r 2025 install version specified in the toolset
$version = (Get-ToolsetContent).mingw.version
$runtime = (Get-ToolsetContent).mingw.runtime

View File

@@ -39,4 +39,18 @@ $mongodbService.WaitForStatus('Running', '00:01:00')
Stop-Service $mongodbService
$mongodbService | Set-Service -StartupType Disabled
# Install mongodb shell for mongodb > 5 version
if (Test-IsWin25) {
$mongoshVersion = (Get-GithubReleasesByVersion -Repo "mongodb-js/mongosh" -Version "latest").version
$mongoshDownloadUrl = Resolve-GithubReleaseAssetUrl `
-Repo "mongodb-js/mongosh" `
-Version $mongoshVersion `
-UrlMatchPattern "mongosh-*-x64.msi"
Install-Binary -Type MSI `
-Url $mongoshDownloadUrl `
-ExpectedSignature 'F2D7C28591847BB2CB2B1C2A0C59459FDC728A38'
}
Invoke-PesterTests -TestFile "Databases" -TestName "MongoDB"

View File

@@ -39,13 +39,13 @@ rustup component add rustfmt clippy
if ($LASTEXITCODE -ne 0) {
throw "Rust component installation failed with exit code $LASTEXITCODE"
}
cargo install bindgen-cli cbindgen cargo-audit cargo-outdated
if ($LASTEXITCODE -ne 0) {
throw "Rust tools installation failed with exit code $LASTEXITCODE"
if (-not (Test-IsWin25)) {
cargo install bindgen-cli cbindgen cargo-audit cargo-outdated
if ($LASTEXITCODE -ne 0) {
throw "Rust tools installation failed with exit code $LASTEXITCODE"
}
# Cleanup Cargo crates cache
Remove-Item "${env:CARGO_HOME}\registry\*" -Recurse -Force
}
# Cleanup Cargo crates cache
Remove-Item "${env:CARGO_HOME}\registry\*" -Recurse -Force
Invoke-PesterTests -TestFile "Rust"

View File

@@ -39,15 +39,18 @@ if (Test-IsWin19) {
Install-Binary -Type EXE `
-Url 'https://go.microsoft.com/fwlink/p/?linkid=2196241' `
-InstallArgs @("/q", "/norestart", "/ceip off", "/features OptionId.UWPManaged OptionId.UWPCPP OptionId.UWPLocalized OptionId.DesktopCPPx86 OptionId.DesktopCPPx64 OptionId.DesktopCPParm64") `
-ExpectedSignature 'E4C5C5FCDB68B930EE4E19BC25D431EF6D864C51'
-ExpectedSignature 'E4C5C5FCDB68B930EE4E19BC25D431EF6D864C51'
}
if (Test-IsWin22) {
if (Test-IsWin22) {
# Install Windows 10 SDK version 10.0.17763
Install-Binary -Type EXE `
-Url 'https://go.microsoft.com/fwlink/p/?LinkID=2033908' `
-InstallArgs @("/q", "/norestart", "/ceip off", "/features OptionId.UWPManaged OptionId.UWPCPP OptionId.UWPLocalized OptionId.DesktopCPPx86 OptionId.DesktopCPPx64 OptionId.DesktopCPParm64") `
-ExpectedSignature '7535269B94C1FEA4A5EF6D808E371DA242F27936'
-Url 'https://go.microsoft.com/fwlink/p/?LinkID=2033908' `
-InstallArgs @("/q", "/norestart", "/ceip off", "/features OptionId.UWPManaged OptionId.UWPCPP OptionId.UWPLocalized OptionId.DesktopCPPx86 OptionId.DesktopCPPx64 OptionId.DesktopCPParm64") `
-ExpectedSignature '7535269B94C1FEA4A5EF6D808E371DA242F27936'
}
if (-not (Test-IsWin19)) {
# Install Windows 11 SDK version 10.0.26100
Install-Binary -Type EXE `
-Url 'https://go.microsoft.com/fwlink/?linkid=2286561' `

View File

@@ -49,3 +49,24 @@ cmd /c "npm cache clean --force 2>&1" | Out-Null
if ($LASTEXITCODE -ne 0) {
throw "Failed to clean npm cache"
}
if (Test-IsWin25) {
$directoriesToCompact = @(
'C:\Windows\assembly',
'C:\Windows\WinSxS'
)
Write-Host "Starting Image slimming process"
$start = get-date
$ErrorActionPreviousValue = $ErrorActionPreference
$ErrorActionPreference = 'SilentlyContinue'
Write-Host "Removing 'C:\Windows\Installer' directory"
Remove-Item "$env:windir\Installer" -Recurse -Force | Out-Null
foreach ($directory in $directoriesToCompact) {
Write-Host "Compressing '$directory' directory"
& compact /s:"$directory" /c /a /i /EXE:LZX * | Out-Null
}
$ErrorActionPreference = $ErrorActionPreviousValue
$finish = get-date
$time = "$(($finish - $start).Minutes):$(($finish - $start).Seconds)"
Write-Host "The process took a total of $time (in minutes:seconds)"
}

View File

@@ -80,16 +80,22 @@ if (Test-IsWin19) {
$tools.AddToolVersion("Google Cloud CLI", $(Get-GoogleCloudCLIVersion))
}
$tools.AddToolVersion("ImageMagick", $(Get-ImageMagickVersion))
$tools.AddToolVersion("InnoSetup", $(Get-InnoSetupVersion))
if (-not (Test-IsWin25)) {
$tools.AddToolVersion("InnoSetup", $(Get-InnoSetupVersion))
}
$tools.AddToolVersion("jq", $(Get-JQVersion))
$tools.AddToolVersion("Kind", $(Get-KindVersion))
$tools.AddToolVersion("Kubectl", $(Get-KubectlVersion))
$tools.AddToolVersion("Mercurial", $(Get-MercurialVersion))
if (-not (Test-IsWin25)) {
$tools.AddToolVersion("Mercurial", $(Get-MercurialVersion))
}
$tools.AddToolVersion("gcc", $(Get-GCCVersion))
$tools.AddToolVersion("gdb", $(Get-GDBVersion))
$tools.AddToolVersion("GNU Binutils", $(Get-GNUBinutilsVersion))
$tools.AddToolVersion("Newman", $(Get-NewmanVersion))
$tools.AddToolVersion("NSIS", $(Get-NSISVersion))
if (-not (Test-IsWin25)) {
$tools.AddToolVersion("NSIS", $(Get-NSISVersion))
}
$tools.AddToolVersion("OpenSSL", $(Get-OpenSSLVersion))
$tools.AddToolVersion("Packer", $(Get-PackerVersion))
if (Test-IsWin19) {
@@ -99,7 +105,9 @@ $tools.AddToolVersion("Pulumi", $(Get-PulumiVersion))
$tools.AddToolVersion("R", $(Get-RVersion))
$tools.AddToolVersion("Service Fabric SDK", $(Get-ServiceFabricSDKVersion))
$tools.AddToolVersion("Stack", $(Get-StackVersion))
$tools.AddToolVersion("Subversion (SVN)", $(Get-SVNVersion))
if (-not (Test-IsWin25)) {
$tools.AddToolVersion("Subversion (SVN)", $(Get-SVNVersion))
}
$tools.AddToolVersion("Swig", $(Get-SwigVersion))
$tools.AddToolVersion("VSWhere", $(Get-VSWhereVersion))
$tools.AddToolVersion("WinAppDriver", $(Get-WinAppDriver))
@@ -109,7 +117,9 @@ $tools.AddToolVersion("zstd", $(Get-ZstdVersion))
# CLI Tools
$cliTools = $installedSoftware.AddHeader("CLI Tools")
$cliTools.AddToolVersion("Alibaba Cloud CLI", $(Get-AlibabaCLIVersion))
if (-not (Test-IsWin25)) {
$cliTools.AddToolVersion("Alibaba Cloud CLI", $(Get-AlibabaCLIVersion))
}
$cliTools.AddToolVersion("AWS CLI", $(Get-AWSCLIVersion))
$cliTools.AddToolVersion("AWS SAM CLI", $(Get-AWSSAMVersion))
$cliTools.AddToolVersion("AWS Session Manager CLI", $(Get-AWSSessionManagerVersion))
@@ -129,10 +139,12 @@ $rustTools.AddToolVersion("Rustdoc", $(Get-RustdocVersion))
$rustTools.AddToolVersion("Rustup", $(Get-RustupVersion))
$rustToolsPackages = $rustTools.AddHeader("Packages")
$rustToolsPackages.AddToolVersion("bindgen", $(Get-BindgenVersion))
$rustToolsPackages.AddToolVersion("cargo-audit", $(Get-CargoAuditVersion))
$rustToolsPackages.AddToolVersion("cargo-outdated", $(Get-CargoOutdatedVersion))
$rustToolsPackages.AddToolVersion("cbindgen", $(Get-CbindgenVersion))
if (-not (Test-IsWin25)) {
$rustToolsPackages.AddToolVersion("bindgen", $(Get-BindgenVersion))
$rustToolsPackages.AddToolVersion("cargo-audit", $(Get-CargoAuditVersion))
$rustToolsPackages.AddToolVersion("cargo-outdated", $(Get-CargoOutdatedVersion))
$rustToolsPackages.AddToolVersion("cbindgen", $(Get-CbindgenVersion))
}
$rustToolsPackages.AddToolVersion("Clippy", $(Get-RustClippyVersion))
$rustToolsPackages.AddToolVersion("Rustfmt", $(Get-RustfmtVersion))
@@ -179,6 +191,9 @@ $databaseTools.AddToolVersion("DacFx", $(Get-DacFxVersion))
$databaseTools.AddToolVersion("MySQL", $(Get-MySQLVersion))
$databaseTools.AddToolVersion("SQL OLEDB Driver", $(Get-SQLOLEDBDriverVersion))
$databaseTools.AddToolVersion("SQLPS", $(Get-SQLPSVersion))
if (Test-IsWin25) {
$databaseTools.AddToolVersion("MongoDB Shell (mongosh)", $(Get-MongoshVersion))
}
# Web Servers
$installedSoftware.AddHeader("Web Servers").AddTable($(Build-WebServersSection))
@@ -222,7 +237,9 @@ Azure PowerShell module 2.1.0 and AzureRM PowerShell module 2.1.0 are installed
and are available via 'Get-Module -ListAvailable'.
All other versions are saved but not installed.
'@
$psModules.AddNote($azPsNotes)
if (-not (Test-IsWin25)) {
$psModules.AddNote($azPsNotes)
}
# Android
$android = $installedSoftware.AddHeader("Android")
@@ -231,7 +248,9 @@ $android.AddTable($(Build-AndroidTable))
$android.AddHeader("Environment variables").AddTable($(Build-AndroidEnvironmentTable))
# Cached Docker images
$installedSoftware.AddHeader("Cached Docker images").AddTable($(Get-CachedDockerImagesTableData))
if (-not (Test-IsWin25)) {
$installedSoftware.AddHeader("Cached Docker images").AddTable($(Get-CachedDockerImagesTableData))
}
# Generate reports
$softwareReport.ToJson() | Out-File -FilePath "C:\software-report.json" -Encoding UTF8NoBOM

View File

@@ -21,8 +21,13 @@ function Get-PostgreSQLTable
function Get-MongoDBTable
{
$name = "MongoDB"
if (Test-IsWin25) {
$command = "mongod"
} else {
$command = "mongo"
}
$mongoService = Get-Service -Name $name
$mongoVersion = (Get-Command -Name 'mongo').Version.ToString()
$mongoVersion = (Get-Command -Name $command).Version.ToString()
return [PSCustomObject]@{
Version = $mongoVersion
ServiceName = $name

View File

@@ -314,3 +314,7 @@ function Get-ImageMagickVersion {
$magickVersion = $Matches.Version
return $magickVersion
}
function Get-MongoshVersion {
return $(mongosh --version)
}

View File

@@ -22,6 +22,7 @@ Export-ModuleMember -Function @(
'Get-ToolsetContent'
'Get-TCToolPath'
'Get-TCToolVersionPath'
'Test-IsWin25'
'Test-IsWin22'
'Test-IsWin19'
'Expand-7ZipArchive'

View File

@@ -307,6 +307,22 @@ function Get-TCToolVersionPath {
return Join-Path $foundVersion $Arch
}
function Test-IsWin25 {
<#
.SYNOPSIS
Checks if the current Windows operating system is Windows Server 2025.
.DESCRIPTION
This function uses the Get-CimInstance cmdlet to retrieve information
about the current Windows operating system. It then checks if the Caption
property of the Win32_OperatingSystem class contains the string "2025",
indicating that the operating system is Windows Server 2025.
.OUTPUTS
Returns $true if the current Windows operating system is Windows Server 2025.
Otherwise, returns $false.
#>
(Get-CimInstance -ClassName Win32_OperatingSystem).Caption -match "2025"
}
function Test-IsWin22 {
<#
.SYNOPSIS

View File

@@ -11,7 +11,7 @@ Describe "Azure DevOps CLI" {
}
}
Describe "Aliyun CLI" {
Describe "Aliyun CLI" -Skip:(Test-IsWin25) {
It "Aliyun CLI" {
"aliyun version" | Should -ReturnZeroExitCode
}
@@ -39,7 +39,7 @@ Describe "GitHub CLI" {
}
}
Describe "CloudFoundry CLI" -Skip:(Test-IsWin22) {
Describe "CloudFoundry CLI" -Skip:(-not (Test-IsWin19)) {
It "cf is located in C:\cf-cli" {
"C:\cf-cli\cf.exe" | Should -Exist
}

View File

@@ -22,13 +22,13 @@ Describe "Bicep" {
}
}
Describe "GitVersion" -Skip:(Test-IsWin22) {
Describe "GitVersion" -Skip:(-not (Test-IsWin19)) {
It "gitversion is installed" {
"gitversion /version" | Should -ReturnZeroExitCode
}
}
Describe "InnoSetup" {
Describe "InnoSetup" -Skip:(Test-IsWin25) {
It "InnoSetup" {
(Get-Command -Name iscc).CommandType | Should -BeExactly "Application"
}
@@ -64,7 +64,7 @@ Describe "Pulumi" {
}
}
Describe "Svn" {
Describe "Svn" -Skip:(Test-IsWin25) {
It "svn" {
"svn --version --quiet" | Should -ReturnZeroExitCode
}
@@ -102,4 +102,4 @@ Describe "ImageMagick" {
It "ImageMagick" {
"magick -version" | Should -ReturnZeroExitCode
}
}
}

View File

@@ -1,7 +1,11 @@
Describe "MongoDB" {
Context "Version" {
It "<ToolName>" -TestCases @(
@{ ToolName = "mongo" }
if (Test-IsWin25) {
@{ ToolName = "mongos" }
} else {
@{ ToolName = "mongo" }
}
@{ ToolName = "mongod" }
) {
$toolsetVersion = (Get-ToolsetContent).mongodb.version
@@ -25,6 +29,10 @@ Describe "MongoDB" {
$StartType | Should -Be "Disabled"
}
}
Context "Shell" -Skip:(-not (Test-IsWin19) -or -not (Test-IsWin22)) {
"mongosh --version" | Should -Not -BeNullOrEmpty
}
}
Describe "PostgreSQL" {

View File

@@ -25,7 +25,7 @@ Describe "DockerWinCred" {
}
}
Describe "DockerImages" {
Describe "DockerImages" -Skip:(Test-IsWin25) {
Context "docker images" {
$testCases = (Get-ToolsetContent).docker.images | ForEach-Object { @{ ImageName = $_ } }

View File

@@ -24,12 +24,18 @@ Describe "Haskell" {
@{envVar = "GHCUP_MSYS2"}
)
If (Test-IsWin25) {
$numberOfVersions = 1
} else {
$numberOfVersions = 3
}
It "<envVar> environment variable exists" -TestCases $ghcupEnvExists {
Test-Path env:\$envVar
}
It "Accurate 3 versions of GHC are installed" -TestCases @{ghcCount = $ghcCount} {
$ghcCount | Should -BeExactly 3
It "Accurate $numberOfVersions versions of GHC are installed" -TestCases @{ghcCount = $ghcCount; numberOfVersions = $numberOfVersions} {
$ghcCount | Should -BeExactly $numberOfVersions
}
It "GHC <ghcVersion> is installed" -TestCases $ghcTestCases {

View File

@@ -5,15 +5,23 @@ Describe "Rust" {
$env:Path += ";$env:CARGO_HOME\bin"
}
$rustTools = @(
@{ToolName = "rustup"; binPath = "C:\Users\Default\.cargo\bin\rustup.exe"}
@{ToolName = "rustc"; binPath = "C:\Users\Default\.cargo\bin\rustc.exe"}
@{ToolName = "bindgen.exe"; binPath = "C:\Users\Default\.cargo\bin\bindgen.exe"}
@{ToolName = "cbindgen.exe"; binPath = "C:\Users\Default\.cargo\bin\cbindgen.exe"}
@{ToolName = "cargo"; binPath = "C:\Users\Default\.cargo\bin\cargo.exe"}
@{ToolName = "cargo audit"; binPath = "C:\Users\Default\.cargo\bin\cargo-audit.exe"}
@{ToolName = "cargo outdated"; binPath = "C:\Users\Default\.cargo\bin\cargo-outdated.exe"}
)
if (Test-IsWin25) {
$rustTools = @(
@{ToolName = "rustup"; binPath = "C:\Users\Default\.cargo\bin\rustup.exe"}
@{ToolName = "rustc"; binPath = "C:\Users\Default\.cargo\bin\rustc.exe"}
@{ToolName = "cargo"; binPath = "C:\Users\Default\.cargo\bin\cargo.exe"}
)
} else {
$rustTools = @(
@{ToolName = "rustup"; binPath = "C:\Users\Default\.cargo\bin\rustup.exe"}
@{ToolName = "rustc"; binPath = "C:\Users\Default\.cargo\bin\rustc.exe"}
@{ToolName = "bindgen.exe"; binPath = "C:\Users\Default\.cargo\bin\bindgen.exe"}
@{ToolName = "cbindgen.exe"; binPath = "C:\Users\Default\.cargo\bin\cbindgen.exe"}
@{ToolName = "cargo"; binPath = "C:\Users\Default\.cargo\bin\cargo.exe"}
@{ToolName = "cargo audit"; binPath = "C:\Users\Default\.cargo\bin\cargo-audit.exe"}
@{ToolName = "cargo outdated"; binPath = "C:\Users\Default\.cargo\bin\cargo-outdated.exe"}
)
}
$rustEnvNotExists = @(
@{envVar = "RUSTUP_HOME"}

View File

@@ -55,19 +55,19 @@ Describe "DACFx" {
"${sqlPackagePath}" | Should -Exist
}
It "SqlLocalDB" -Skip:(Test-IsWin22) {
It "SqlLocalDB" -Skip:(-not (Test-IsWin19)) {
$sqlLocalDBPath = 'C:\Program Files\Microsoft SQL Server\130\Tools\Binn\SqlLocalDB.exe'
"${sqlLocalDBPath}" | Should -Exist
}
}
Describe "DotnetTLS" -Skip:(Test-IsWin22) {
Describe "DotnetTLS" -Skip:(-not (Test-IsWin19)) {
It "Tls 1.2 is enabled" {
[Net.ServicePointManager]::SecurityProtocol -band "Tls12" | Should -Be Tls12
}
}
Describe "Mercurial" {
Describe "Mercurial" -Skip:(Test-IsWin25) {
It "Mercurial" {
"hg --version" | Should -ReturnZeroExitCode
}
@@ -101,7 +101,7 @@ Describe "Mingw64" {
}
}
Describe "GoogleCloudCLI" -Skip:(Test-IsWin22) {
Describe "GoogleCloudCLI" -Skip:(-not (Test-IsWin19)) {
It "<ToolName>" -TestCases @(
@{ ToolName = "bq" }
@{ ToolName = "gcloud" }
@@ -117,7 +117,7 @@ Describe "NET48" {
}
}
Describe "NSIS" {
Describe "NSIS" -Skip:(Test-IsWin25) {
It "NSIS" {
"makensis /VERSION" | Should -ReturnZeroExitCode
}
@@ -175,7 +175,7 @@ Describe "Vcpkg" {
}
}
Describe "VCRedist" -Skip:(Test-IsWin22) {
Describe "VCRedist" -Skip:(-not (Test-IsWin19)) {
It "vcredist_2010_x64" {
"HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{1D8E6291-B0D5-35EC-8441-6616F567A0F7}" | Should -Exist
"C:\Windows\System32\msvcr100.dll" | Should -Exist

View File

@@ -25,20 +25,20 @@ Describe "Visual Studio" {
}
}
Describe "Windows 10 SDK" {
It "Verifies 17763 SDK is installed" -Skip:(Test-IsWin19) {
Describe "Windows 10 SDK" -Skip:((Test-IsWin19) -or (Test-IsWin25)) {
It "Verifies 17763 SDK is installed" {
"${env:ProgramFiles(x86)}\Windows Kits\10\DesignTime\CommonConfiguration\Neutral\UAP\10.0.17763.0\UAP.props" | Should -Exist
}
}
Describe "Windows 11 SDK" {
It "Verifies 22621 SDK is installed" -Skip:(Test-IsWin22) {
Describe "Windows 11 SDK" -Skip:(-not (Test-IsWin19)) {
It "Verifies 22621 SDK is installed" {
"${env:ProgramFiles(x86)}\Windows Kits\10\DesignTime\CommonConfiguration\Neutral\UAP\10.0.22621.0\UAP.props" | Should -Exist
}
}
Describe "Windows 11 SDK" {
It "Verifies 26100 SDK is installed" -Skip:(Test-IsWin19) {
Describe "Windows 11 SDK" -Skip:(Test-IsWin19) {
It "Verifies 26100 SDK is installed" {
"${env:ProgramFiles(x86)}\Windows Kits\10\DesignTime\CommonConfiguration\Neutral\UAP\10.0.26100.0\UAP.props" | Should -Exist
}
}

View File

@@ -1,4 +1,4 @@
Describe "WDK" {
Describe "WDK" -Skip:(Test-IsWin25) {
It "WDK exists" {
$regKey = "HKLM:\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\*"
$installedApplications = Get-ItemProperty -Path $regKey