Created
July 29, 2024 05:06
-
-
Save ktwrd/76c4d0fb5454e7b0700ce5ce2d406c8e to your computer and use it in GitHub Desktop.
Fix Broken/Blank Toolbox in Visual Studio
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # | |
| # 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