GetHostEntry causes Exception 0x80004005

The function “Get-PendingReboot” uses this string to set the ComputerName variable.
[string]$private:ComputerName = ([Net.Dns]::GetHostEntry(’’)).HostName
On a Server 2008 R2 system, it is throwing an exception (0x80004005) “The requested name is valid, but no data of the requested type was found.”
Does anyone know why this might be happening? Yes I know, Server 2008 is really old, but I am required to maintain it.
I did some Googling and some people suggest using a different way to get the hostname like IPHostEntry(), or some way that doesn’t require a .NET call, but I don’t know how to do that. Not really much of a programmer.
Can anyone suggest a fix to make this more compatible with various systems?
Thank you!

We have implemented a couple of fixes for GetHostEntry already: https://github.com/PSAppDeployToolkit/PSAppDeployToolkit/pull/548

You can either try to download the toolkit folder or wait for the next release.