If using MsBuild in the CLI (such as CI/CD pipelines):
MSBuild.exe MyProject.csproj /noWarn:NU1901,NU1902,NU1903,NU1904