I need to know if there is a piece of code in C# for .NET CORE 2.1 to know if the machine where the code is running, has the latest windows updates or eventually it needs to be updated.
Thanks in advance.
I'm not sure if there's anything native in .Net core, but you could shell out to wmic to get this information, the following command will list all installed updates: wmic qfe list full
Full wmic docs available at: https://learn.microsoft.com/en-us/windows/desktop/wmisdk/wmic
As a note of caution - obviously .NET Core is cross-platform whereas this is very much Windows specific...