PowerShell get your computername and domain

Submitted by wesneski100 on Sun, 04/26/2020 - 20:55

Often we need to know either ours or servers that we work on's fully qualified domain name or just the computer name and domain name  Here are some ways to get them:

computer name:  $env:computername