ps/Modules/Alkami.PowerShell.Configuration/Public/Test-IsWebServer.ps1
2023-05-30 22:51:22 -07:00

31 lines
733 B
PowerShell

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