Skip to content

Commit

Permalink
Improvements to collect-wsl-logs.ps1 (#12320)
Browse files Browse the repository at this point in the history
* Improve collect-wsl-logs.ps1 collect uninstall logs and less windows version reg key info

* Update redirection syntax to match rest of file

---------

Co-authored-by: Ben Hillis (from Dev Box) <[email protected]>
  • Loading branch information
benhillis and Ben Hillis (from Dev Box) authored Nov 26, 2024
1 parent ef61f61 commit 757df6a
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion diagnostics/collect-wsl-logs.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ reg.exe export HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\P9NP $folder
reg.exe export HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\WinSock2 $folder/Winsock2.txt 2>&1 | Out-Null
reg.exe export "HKEY_CLASSES_ROOT\CLSID\{e66b0f30-e7b4-4f8c-acfd-d100c46c6278}" $folder/wslsupport-proxy.txt 2>&1 | Out-Null
reg.exe export "HKEY_CLASSES_ROOT\CLSID\{a9b7a1b9-0671-405c-95f1-e0612cb4ce7e}" $folder/wslsupport-impl.txt 2>&1 | Out-Null
reg.exe export "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion" $folder/windows-version.txt 2>&1 | Out-Null
Get-ItemProperty -Path "Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion" > $folder/windows-version.txt

Get-Service wslservice -ErrorAction Ignore | Format-list * -Force > $folder/wslservice.txt

Expand All @@ -57,6 +57,12 @@ get-acl "C:\ProgramData\Microsoft\Windows\WindowsApps" -ErrorAction Ignore | For
Get-WindowsOptionalFeature -Online > $folder/optional-components.txt
bcdedit.exe > $folder/bcdedit.txt

$uninstallLogs = "$env:TEMP/wsl-uninstall-logs.txt"
if (Test-Path $uninstallLogs)
{
Copy-Item $uninstallLogs $folder | Out-Null
}

$wprOutputLog = "$folder/wpr.txt"

wpr.exe -start $LogProfile -filemode 2>&1 >> $wprOutputLog
Expand Down

0 comments on commit 757df6a

Please sign in to comment.