How To Get Fully Qualified Domain Name Windows Snippet

To get the FQDN for the current host:

1
[System.Net.Dns]::GetHostByName(($env:computerName))