Powershell script to uninstall Microsoft .NET Core 5.0

Job ID: 36123505

Budget: £20 – £250 GBP

I have a large number of devices with Microsoft .NET CORE 5.0 installed, which is now showing as a critical vulnerability in Qualys as it is no longer supported by Microsoft. I have attempted to install Microsoft .NET 6.0 on some test devices, but this did not uninstall or remove the 5.0 version.

I have come across the .NET uninstall tool from Microsoft, however this is not a feasible option due to the sheer number of devices that have the application installed. We are using Intune to manage all our devices, so I was wondering if the best option will be a powershell script that can be deployed to those devices via Intune or if there's a better option.
Related categories: .NET Powershell