Skip to content

Instantly share code, notes, and snippets.

@matarillo
Created October 7, 2021 10:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save matarillo/e945cdc6b275b8516c07989dca220445 to your computer and use it in GitHub Desktop.
Save matarillo/e945cdc6b275b8516c07989dca220445 to your computer and use it in GitHub Desktop.
$psi = New-Object Diagnostics.ProcessStartInfo
$psi.FileName = $env:LOCALAPPDATA + "\Microsoft\WindowsApps\winget.exe"
$psi.Arguments = "list"
$psi.UseShellExecute = $false
$psi.StandardOutputEncoding = [Text.Encoding]::UTF8
$psi.RedirectStandardOutput = $true
$p = [Diagnostics.Process]::Start($psi)
$s = $p.StandardOutput.ReadToEnd()
$p.WaitForExit()
$p.Dispose()
$s
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment