public/domainName.ps1

#region Header

#endregion Header
#region Data

#endregion Data
#region Main Functions
<#
    .SYNOPSIS
        Enforces the behavior of getting the domain name.
        If a domain name is provided, it will be used.
        If a domain name is not provided, the domain name of the generating system will be used.
 
    .NOTES
        General notes
#>

function Get-DomainName
{
    [cmdletbinding()]
    [outputtype([string])]
    param
    (
        [parameter()]
        [string]
        $Name
    )

    if ( [string]::IsNullOrEmpty( $Name ) )
    {
        return $env:USERDOMAIN
    }
    else
    {
        return $Name
    }
}
#endregion Main Functions
#region Support Functions

#endregion Support Functions