Has anyone found a good script to uninstall old versions of .NET Core? We’re running through vulnerabilities and we have a lot of servers running older unsupported versions of .NET Core Server Hosting. I’ve been able to upgrade .NET 6.0 without issue but it seems 3.1 versions just won’t update or go away. We have roughly 40+ servers running multiple versions of .NET Core. None are the SDK version so the .NET uninstall tool doesn’t work on them. I’ve tried a script to download the ASP.NET Core Hosting exe and running the uninstall commands from there and, nothing. I’ve tried installing a newer version of 3.1 over the existing version (like I did with 6.0) and didn’t take. How are all of you managing .NET Core versions and eliminating unsupported versions from your environment?
I’m at a loss at this point. There are not SDKs and there is no Visual Studio. So there seems to be no easy way to remove these old .NET versions especially when the uninstaller process via Automox can’t provide any info via the activity log even if I tell it to log and use the Get-Content -Path logfilename option.