]> git.proxmox.com Git - ceph.git/blob - ceph/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/azure-pipelines/windows/deploy-windows-wdk.ps1
update ceph source to reef 18.1.2
[ceph.git] / ceph / src / jaegertracing / opentelemetry-cpp / tools / vcpkg / scripts / azure-pipelines / windows / deploy-windows-wdk.ps1
1 # Copyright (c) Microsoft Corporation.
2 # SPDX-License-Identifier: MIT
3
4 # REPLACE WITH DROP-TO-ADMIN-USER-PREFIX.ps1
5
6 # REPLACE WITH UTILITY-PREFIX.ps1
7
8 $WindowsWDKUrl = 'https://go.microsoft.com/fwlink/?linkid=2128854'
9
10 <#
11 .SYNOPSIS
12 Installs Windows WDK version 2004
13
14 .DESCRIPTION
15 Downloads the Windows WDK installer located at $Url, and installs it with the
16 correct flags.
17
18 .PARAMETER Url
19 The URL of the installer.
20 #>
21 Function InstallWindowsWDK {
22 Param(
23 [String]$Url
24 )
25
26 try {
27 Write-Host 'Downloading Windows WDK...'
28 [string]$installerPath = Get-TempFilePath -Extension 'exe'
29 curl.exe -L -o $installerPath -s -S $Url
30 Write-Host 'Installing Windows WDK...'
31 $proc = Start-Process -FilePath $installerPath -ArgumentList @('/features', '+', '/q') -Wait -PassThru
32 $exitCode = $proc.ExitCode
33 if ($exitCode -eq 0) {
34 Write-Host 'Installation successful!'
35 }
36 else {
37 Write-Error "Installation failed! Exited with $exitCode."
38 throw
39 }
40 }
41 catch {
42 Write-Error "Failed to install Windows WDK! $($_.Exception.Message)"
43 throw
44 }
45 }
46
47 InstallWindowsWDK -Url $WindowsWDKUrl