Skip to content

Instantly share code, notes, and snippets.

@Jammyjamjamman
Created June 5, 2021 19:29
Show Gist options
  • Save Jammyjamjamman/589fe674c5592a194aba817b7cc8e9b1 to your computer and use it in GitHub Desktop.
Save Jammyjamjamman/589fe674c5592a194aba817b7cc8e9b1 to your computer and use it in GitHub Desktop.
Get list of installed vcpkgs. Output can be passed to "vcpkg install ..."
# Creates a space-separated list of packages installed in your vcpkg instance.
# Expects to be executed in the same dir as your vcpkg.exe.
$packages_list = ""
# Used to exclude packages with square brackets, because they're a subpackage of another package.
# Also only select x64-windows-static installed packages.
$packages_select_string = "[^\]]:x64-windows-static"
.\vcpkg.exe list | Select-String $packages_select_string | ForEach-Object -Process {
$packages_list += ($_ -split ' ')[0] + ' '
}
Write-Output $packages_list.Substring(0, $packages_list.Length-1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment