Enable Network Discovery (PowerShell)

I hate having to do this manually on Windows Server. It never works. Here is a script!

cd $env:temp; powershell -c "Invoke-WebRequest -Uri 'https://git.icanhazfiles.com/cmyron/enable-networkdiscovery/-/raw/main/Enable-NetworkDiscovery.ps1' -OutFile $env:temp'\Enable-NetworkDiscovery.ps1'"; powershell.exe -Executionpolicy unrestricted -command .\Enable-NetworkDiscovery.ps1; rm .\Enable-NetworkDiscovery.ps1