Function Test-IsWebServer { <# .SYNOPSIS Used to determine if the current server is a Web tier server .PARAMETER ComputerName [string] Optional. Specify a computer name instead of inspecting the local computer name. #> [CmdletBinding()] [OutputType([System.Boolean])] param( [Parameter(Mandatory = $false)] [string]$ComputerName = $null ) if ([string]::IsNullOrWhiteSpace($ComputerName)) { $ComputerName = (Get-FullyQualifiedServerName) } # Then let's check the server name if ($ComputerName.ToUpper().StartsWith("WEB")) { return $true } # Put any future checks here return $false } Set-Alias IsWebServer Test-IsWebServer -Force -Scope:Global