Skip to content

Instantly share code, notes, and snippets.

@lazuee
Created February 15, 2025 17:30
Show Gist options
  • Select an option

  • Save lazuee/c2a853f2cc26a3531d2b284553a0b0b7 to your computer and use it in GitHub Desktop.

Select an option

Save lazuee/c2a853f2cc26a3531d2b284553a0b0b7 to your computer and use it in GitHub Desktop.

Revisions

  1. lazuee created this gist Feb 15, 2025.
    3 changes: 3 additions & 0 deletions winget-install-vcredist-aio.ps1
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,3 @@
    $arch = ((systeminfo | findstr /C:"System Type") -replace 'System Type:\s*', '' -split '-')[0].Trim().ToLower()
    $ids = winget search Microsoft.VCRedist | Where-Object { $_ -match $arch } | ForEach-Object { [regex]::Match($_,'(Microsoft\.VCRedist\S+)').Value }
    $ids | ForEach-Object { winget install -e --id $_ }