Install nuget and DSC modules via script

I am trying to install DSC Module on a basic Windows 2019 Server. It just fails silently. This is a brand new servers that are failing

[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
if(!(get-packageprovider -name nuget)){
    Install-PackageProvider -Name NuGet -RequiredVersion 2.8.5.201 -Force -Scope CurrentUser
  }

Set-PSRepository -Name 'PsGallery' -InstallationPolicy Trusted
Install-Module -Name NetworkingDsc -RequiredVersion 8.1.0 -AllowClobber -Repository PSGallery -Verbose

What is the error you are getting ?

No error. It just fails silently

use -ErrorAction Stop for all the cmdlets. It should fail, else its wont be easy to find the reason.