33 lines
1.2 KiB
PowerShell
33 lines
1.2 KiB
PowerShell
function Test-IsDeveloperMachine {
|
|
<#
|
|
.SYNOPSIS
|
|
Is the current machine a developer's environment or a QA/Staging/Production environment?
|
|
|
|
.PARAMETER ComputerName
|
|
What computer do we check, defaults to localhost
|
|
#>
|
|
[CmdletBinding()]
|
|
[OutputType([System.Boolean])]
|
|
param (
|
|
[string]$ComputerName = 'localhost'
|
|
)
|
|
|
|
$environmentType = (Get-EnvironmentType -ComputerName $ComputerName)
|
|
|
|
$environmentTypeNames = @('Development', 'Unknown', 'SDK', 'Sandbox', '', $null)
|
|
|
|
if ((Select-AlkamiTeaServers -Servers $ComputerName) -or
|
|
(Select-AlkamiAppServers -Servers $ComputerName) -or
|
|
(Select-AlkamiMicServers -Servers $ComputerName) -or
|
|
(Select-AlkamiWebServers -Servers $ComputerName)) {
|
|
return $false
|
|
} else {
|
|
return ($environmentTypeNames -contains $environmentType)
|
|
}
|
|
}
|
|
|
|
Set-Alias -Name Test-IsDevelopmentEnvironment -Value Test-IsDeveloperMachine
|
|
|
|
# If the tag doesn't exist this is a development machine or should be treated as such.
|
|
# This is the only place that we can accept a missing env-type var
|
|
# return ([string]::IsNullOrWhiteSpace($environmentType)) -or ($environmentTypeNames -contains $environmentType) |