Skip to content

Instantly share code, notes, and snippets.

@madskristensen
Last active June 25, 2021 15:50
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save madskristensen/43ea4267331a328e872cd2431f83a75a to your computer and use it in GitHub Desktop.
Save madskristensen/43ea4267331a328e872cd2431f83a75a to your computer and use it in GitHub Desktop.
Remove Preview badge in VS

To remove the preview badge in VS, you must perform two tasks. First delete a file in the VS install directory called $(InstallDir)\Common7\IDE\Microsoft.VisualStudio.PreviewBadge.pkgdef and then execute devenv /UpdateConfiguration.

To make that easier, do this:

  1. Copy the content of RemoveBadgeInVS.ps1 and save it to disk anywhere.
  2. Go to this website and scroll down to download Add_PS1_Run_as_administrator.reg and run it.

You can now right-click RemoveBadgeInVS.ps1 and select Run as administrator. This will remove the badge from any version of Visual Studio you've got installed.

function RemoveBadge {
param ($path)
Write-Host "Looking for PreviewBadge.pkgdef in $path"
$file = Get-ChildItem -Path $path -Include *previewbadge.pkgdef -Recurse
if ($file){
Remove-Item $file
Write-Host "PreviewBadge.pkgdef deleted"
Write-Host "Calling devenv.exe /UpdateConfiguration"
$devenv = Get-ChildItem -Path $path -Include devenv.exe -Recurse
Start-Process $devenv -ArgumentList "/UpdateConfiguration"
}
else {
Write-Host "PreviewBadge.pkgdef not found"
}
}
RemoveBadge "C:\Program Files (x86)\Microsoft Visual Studio\"
RemoveBadge "C:\Program Files\Microsoft Visual Studio\"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment