Skip to content

Instantly share code, notes, and snippets.

@lzybkr
Last active November 11, 2025 15:14
Show Gist options
  • Select an option

  • Save lzybkr/a39f6c07be4891ee9fac6bf6eb13893e to your computer and use it in GitHub Desktop.

Select an option

Save lzybkr/a39f6c07be4891ee9fac6bf6eb13893e to your computer and use it in GitHub Desktop.
Download and extract the latest WinDbg without installing so you can run on systems like Windows Server
param(
$OutDir = ".",
[ValidateSet("x64", "x86", "arm64")]
$Arch = "x64"
)
if (!(Test-Path $OutDir)) {
$null = mkdir $OutDir
}
# Download the appinstaller to find the current uri for the msixbundle
Invoke-WebRequest https://aka.ms/windbg/download -OutFile $OutDir\windbg.appinstaller
# Download the msixbundle
$msixBundleUri = ([xml](Get-Content $OutDir\windbg.appinstaller)).AppInstaller.MainBundle.Uri
if ($PSVersionTable.PSVersion.Major -lt 6) {
# This is a workaround to get better performance on older versions of PowerShell
$ProgressPreference = 'SilentlyContinue'
}
# Download the msixbundle (but name as zip for older versions of Expand-Archive
Invoke-WebRequest $msixBundleUri -OutFile $OutDir\windbg.zip
# Extract the 3 msix files (plus other files)
Expand-Archive -DestinationPath $OutDir\UnzippedBundle $OutDir\windbg.zip
# Rename msix (for older versions of Expand-Archive) and extract the debugger
Move-Item "$OutDir\UnzippedBundle\windbg_win-$Arch.msix" "$OutDir\UnzippedBundle\windbg_win-$Arch.zip"
Expand-Archive -Path "$OutDir\UnzippedBundle\windbg_win-$Arch.zip" -DestinationPath "$OutDir\windbg"
# Now you can run:
& $OutDir\windbg\DbgX.Shell.exe
@haxzion
Copy link

haxzion commented Sep 9, 2025

worked perfectly thank you

@Lamisedaxeh
Copy link

Worked, Thanks !

@roeer-bug
Copy link

PS C:\Users\HP> Invoke-WebRequest https://aka.ms/windbg/download -OutFile $OutDir\windbg.appinstaller
Invoke-WebRequest : 403 Forbidden
kngx/1.10.2
所在位置 行:1 字符: 1

  • Invoke-WebRequest https://aka.ms/windbg/download -OutFile $OutDir\win ...
  •   + CategoryInfo          : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-WebRequest],WebExce
      ption
      + FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeWebRequestCommand
    

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment