ps/Modules/Alkami.PowerShell.Configuration/Public/Get-EnvironmentServer.ps1

33 lines
827 B
PowerShell
Raw Normal View History

2023-05-30 22:51:22 -07:00
function Get-EnvironmentServer {
<#
.SYNOPSIS
Wrapper for Get-AppSetting for Environment.Server
.PARAMETER ComputerName
[string] The remote computer to connect to. Defaults to localhost.
#>
[CmdletBinding()]
[OutputType([string])]
param (
[Parameter(Mandatory = $false)]
[string]$ComputerName
)
$logLead = (Get-LogLeadName)
if ([string]::IsNullOrWhiteSpace($ComputerName)) {
Write-Warning "$logLead : ComputerName is null or whitespace, assigning 'localhost' to ComputerName"
$ComputerName = 'localhost'
}
$params = @{
Key = "Environment.Server"
ComputerName = $ComputerName
}
$appSetting = Get-AppSetting @params
Write-Verbose "$logLead : ComputerName: [$ComputerName] App Setting value: [$appSetting]"
return $appSetting
}