ps/Modules/Cole.PowerShell.Developer/Public/Get-CurrentDomainName.ps1

15 lines
274 B
PowerShell
Raw Normal View History

2023-05-30 22:51:22 -07:00
function Get-CurrentDomainName {
<#
.SYNOPSIS
Get the current domain name of the machine
#>
[CmdletBinding()]
param (
)
if (Test-IsWindowsPlatform) {
return (Get-CimInstance Win32_ComputerSystem -Property Domain).Domain
}
return $null
}