function Get-LocalComputerName { <# .SYNOPSIS Retrieves the name of the local computer. #> [CmdletBinding()] param() process { # Using cross-platform .NET method for native speed and compatibility return [System.Environment]::MachineName } }