Skip to content

Instantly share code, notes, and snippets.

@ktwrd
Created July 29, 2024 05:06
Show Gist options
  • Select an option

  • Save ktwrd/76c4d0fb5454e7b0700ce5ce2d406c8e to your computer and use it in GitHub Desktop.

Select an option

Save ktwrd/76c4d0fb5454e7b0700ce5ce2d406c8e to your computer and use it in GitHub Desktop.
Fix Broken/Blank Toolbox in Visual Studio
#
# DESCRIPTION:
# - Script that fixes an empty toolbox in Visual Studio when you *know* that
# things should be showing up in the toolbox.
#
# NOTE:
# - Make sure that Visual Studio is closed before running this!
$xi = Get-ChildItem -Path $env:LocalAppData\Microsoft\VisualStudio -Directory
$targetFiles = @(
"toolbox.tbd",
"toolbox_reset.tbd",
"toolboxIndex.tbd",
"toolboxIndex_reset.tbd"
);
$rs = $xi | Where-Object { $_.Name -match '[0-9]+\.[0-9]+(|_[0-9a-fA-F]{4,})'}
foreach ($x in $rs)
{
foreach ($i in $targetFiles)
{
$p = "$x\$i";
if (Test-Path $p)
{
Remove-Item $p -Verbose
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment