-
Notifications
You must be signed in to change notification settings - Fork 245
/
Copy pathinstall-ebpf-for-windows.ps1
37 lines (29 loc) · 1.26 KB
/
install-ebpf-for-windows.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# Copyright (c) Microsoft Corporation
# SPDX-License-Identifier: MIT
# Make sure the script is running in a HostProcess container.
if ($env:CONTAINER_SANDBOX_MOUNT_POINT) {
$ns = $env:CONTAINER_SANDBOX_MOUNT_POINT
write-host ("Install script is running in a HostProcess container. This sandbox mount point is {0}" -f $ns)
} else {
throw "Install script is NOT running in a HostProcess container."
}
Write-Host "Installing VC Redistributable. This will take a while ..."
invoke-webrequest https://aka.ms/vs/17/release/vc_redist.x64.exe -OutFile vc_redist.x64.exe
.\vc_redist.x64.exe
Write-Host "Installation of VC Redistributable completed."
Start-Sleep -Seconds 10
Write-Host "Installing ebpf-for-windows ..."
.\ebpf-for-windows.msi /quiet /L*V ".\ebpf-for-windows.install.log"
Start-Sleep -Seconds 10
# Make sure netsh ebpf works.
Write-Host "ebpf-for-windows installation completed. Show program..."
netsh ebpf show program
# Sleep until the container is required to exit explicitly. This is for dev only.
# TODO: If this container is running as an init container of a daemonset,
# this section is not required.
$filePath = 'C:\exit-ebpfwin-install-container.txt'
while (-not (Test-Path -Path $filePath)) {
Start-Sleep -Seconds 30
}
write-host "All done."
exit 0