forked from microsoft/ebpf-for-windows
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcleanup_ebpf_cicd_tests.ps1
27 lines (19 loc) · 1.03 KB
/
cleanup_ebpf_cicd_tests.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
# Copyright (c) Microsoft Corporation
# SPDX-License-Identifier: MIT
param ([parameter(Mandatory=$false)][string] $Target = "TEST_VM",
[parameter(Mandatory=$false)][string] $LogFileName = "TestLog.log",
[parameter(Mandatory=$false)][string] $WorkingDirectory = $pwd.ToString(),
[parameter(Mandatory=$false)][string] $VMListJsonFileName = "vm_list.json")
Push-Location $WorkingDirectory
$TestVMCredential = Get-StoredCredential -Target $Target -ErrorAction Stop
# Load other utility modules.
Import-Module .\common.psm1 -Force -ArgumentList ($LogFileName) -WarningAction SilentlyContinue
Import-Module .\config_test_vm.psm1 -Force -ArgumentList ($TestVMCredential.UserName, $TestVMCredential.Password, $WorkingDirectory, $LogFileName) -WarningAction SilentlyContinue
# Read the config json.
$Config = Get-Content ("{0}\{1}" -f $PSScriptRoot, $VMListJsonFileName) | ConvertFrom-Json
$VMList = $Config.VMList
# Import logs from VMs.
Import-ResultsFromVM -VMList $VMList
# Stop the VMs.
Stop-AllVMs -VMList $VMList
Pop-Location