Skip to content

Commit 388a56a

Browse files
committed
win_guest_debugging_tool: Support new feature
win_guest_debugging_tool is a new feature for windows guest to gather a wide range of information. including system configuration event logs, drivers, registry settings, update logs, services, uptime, processes, installed applications,network configuration installed KBs (knowledge base articleand optionally, memory dumps It's a powershell script is designed for comprehensive system diagnostics. Signed-off-by: Dehan Meng <[email protected]>
1 parent d516da1 commit 388a56a

File tree

2 files changed

+728
-0
lines changed

2 files changed

+728
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
- win_guest_debugging_tool: install setup image_copy unattended_install.cdrom
2+
only Windows
3+
type = win_guest_debugging_tool
4+
tmp_dir = %TEMP%
5+
runtimeout = 360
6+
shutdown_command = "shutdown -s -t 0"
7+
reboot_command = "shutdown -r -t 0"
8+
cmd_unrestrict_policy = 'powershell.exe Set-ExecutionPolicy -ExecutionPolicy Unrestricted -Scope Process -Force'
9+
test_tmp_dir = "%TEMP%\testtmpdir"
10+
cmd_create_dir = "mkdir %s >nul 2>&1"
11+
cmd_remove_dir = "rmdir /S /Q %s"
12+
cdroms += " virtio"
13+
cdrom_virtio = isos/windows/virtio-win.iso
14+
cmd_findstr_in_file = type %s | findstr "%s"
15+
include_sensitive_data = False
16+
variants:```
17+
- check_script_execution:
18+
windegtool_check_type = script_execution
19+
- check_zip_package:
20+
windegtool_check_type = zip_package
21+
cmd_extract_zip = 'powershell.exe Expand-Archive -Path "%s" -DestinationPath %s -Force'
22+
cmd_check_folder_size = powershell -c "$folderPath='%s'; $folderSize=(Get-ChildItem -Path $folderPath -Recurse | Measure-Object -Property Length -Sum).Sum; Write-Output $folderSize"
23+
- check_run_tools_multi_times:
24+
windegtool_check_type = run_tools_multi_times
25+
- check_user_friendliness:
26+
windegtool_check_type = user_friendliness
27+
cmd_kill_powershell_process = taskkill /IM powershell.exe /F; powershell.exe -Command "Stop-Process -Name msinfo32 -Force"
28+
invalid_params = "-invalidparam,IncludeSensitiveData,0000,hell,-H,-IncludeSensitiveData -h"
29+
expect_output_prompt = "Usage: .\CollectSystemInfo.ps1 [-IncludeSensitiveData] [-Help]"
30+
script_interrupt_signal_file = 'Collecting_Status.txt'
31+
cmd_dir_del = powershell.exe -Command "Remove-Item -Path '%s' -Recurse -Force -ErrorAction SilentlyContinue"
32+
cmd_query_path = powershell.exe "$lastDir = dir | Select-String 'System*' | Select-Object -Last 1; write-output $lastDir"
33+
- check_disk_registry_collection:
34+
windegtool_check_type = disk_registry_collection
35+
virtio_disk_filepath = "%s\virtio_disk.txt"
36+
new_reg_item = "HKLM:\SYSTEM\CurrentControlSet\Services\viostor\Parameters"
37+
exist_reg_item = "HKLM:\SYSTEM\CurrentControlSet\Services\Disk"
38+
cmd_reg_query = powershell.exe -Command "(Get-ItemProperty -Path %s).%s"
39+
cmd_reg_add_item = powershell.exe "if (-not (Test-Path -Path '%s')) {New-Item -Path %s | Out-Null}"
40+
cmd_reg_add_item_key = powershell.exe "if (-not (Test-Path -Path '%s')) {New-Item -Path %s -Name %s -ItemType Key | Out-Null}"
41+
cmd_reg_set_value = powershell.exe -Command "Set-ItemProperty -Path '%s' -Name '%s' -Value %d"
42+
cmd_reg_del = powershell.exe -Command "Remove-Item -Path '%s' -Recurse -Force -ErrorAction SilentlyContinue"
43+
reg_subkey1 = IoTimeoutValue
44+
reg_subkey2 = TimeoutValue
45+
key_value1 = 100
46+
key_value2 = 150
47+
- check_includeSensitiveData_collection:
48+
windegtool_check_type = includeSensitiveData_collection
49+
include_sensitive_data = True
50+
timeout = 360
51+
reboot_method = system_reset
52+
memory_dmp_file = "%SystemRoot%\Memory.dmp"
53+
mini_dmp_folder = "%SystemRoot%\Minidump"
54+
crash_method = nmi
55+
cmd_check_files = powershell.exe ls %s
56+
- check_trigger_driver_msinfo_collection:
57+
windegtool_check_type = trigger_driver_msinfo_collection
58+
image_snapshot = yes
59+
transfer_timeout = 720
60+
msinfo_file_path = "%s\msinfo32.txt"
61+
drv_list_file_path = "%s\drv_list.csv"
62+
target_driver = pvpanic
63+
cmd_query_oem_inf = powershell.exe -Command "pnputil.exe /enum-drivers | Select-String -Pattern '%s.inf' -Context 1,1 | ForEach-Object { if ($_ -match 'Published Name:\s+(oem\d+\.inf)') { $matches[1] } }"
64+
cmd_install_driver = pnputil.exe /add-driver "%s.inf" /install
65+
cmd_uninstall_driver = pnputil.exe /delete-driver %s /uninstall /force
66+
cmd_scan_device = pnputil.exe /scan-devices
67+
cmd_backup_driver = Export-WindowsDriver -Online -Destination "C:\DriverBackup"
68+
cmd_check_driver_ver = powershell.exe -Command "Get-WmiObject Win32_PnPSignedDriver | Where-Object DeviceName -eq '%s'"
69+
new_system_name = "NewsystemName"
70+
cmd_change_systemname = powershell.exe -Command "Rename-Computer -NewName %s"
71+
cmd_query_from_file = powershell.exe -Command "Get-Content %s | Select-String '%s'"
72+
cmd_check_systemname = echo %computername%
73+
- check_networkadapter_collection:
74+
windegtool_check_type = networkadapter_collection
75+
check_adapter_name = powershell.exe -Command "Get-NetAdapter | Select-Object -ExpandProperty Name"
76+
check_adapter_jp_info = powershell.exe -Command "Get-NetAdapterAdvancedProperty -Name '%s' | Where-Object { $_.DisplayName -eq 'Jumbo Packet' } | Select-Object -ExpandProperty DisplayValue"
77+
cmd_set_adapter_jp_info = powershell.exe -Command "Set-NetAdapterAdvancedProperty -Name '%s' -DisplayName 'Jumbo Packet' -DisplayValue %d"
78+
cmd_disable_adapter = powershell.exe -Command "Disable-NetAdapter -Name '%s' -Confirm:$false"
79+
cmd_enable_adapter = powershell.exe -Command "Enable-NetAdapter -Name '%s' -Confirm:$false"
80+
networkfile_path = "%s\NetworkInterfaces.txt"
81+
ipconfigfile_path = "%s\IPConfiguration.txt"
82+
static_dns = 8.8.8.8
83+
cmd_get_dns = powershell.exe -Command (Get-DnsClientServerAddress -AddressFamily IPv4).ServerAddresses
84+
cmd_set_dns = netsh interface ipv4 set dns name="%s" static %s
85+
cmd_set_dns_dhcp = netsh interface ipv4 set dns name="%s" dhcp
86+
- check_documentation:
87+
windegtool_check_type = documentation

0 commit comments

Comments
 (0)