31 lines
734 B
PowerShell
31 lines
734 B
PowerShell
|
Function Test-IsAppServer {
|
||
|
<#
|
||
|
.SYNOPSIS
|
||
|
Used to determine if the current server is an App 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("APP")) {
|
||
|
return $true
|
||
|
}
|
||
|
|
||
|
# Put any future checks here
|
||
|
|
||
|
return $false
|
||
|
}
|
||
|
|
||
|
Set-Alias IsAppServer Test-IsAppServer -Force -Scope:Global
|