ps/Modules/Alkami.PowerShell.Configuration/Public/Set-EnvironmentDesignation.ps1

38 lines
985 B
PowerShell
Raw Permalink Normal View History

2023-05-30 22:51:22 -07:00
function Set-EnvironmentDesignation {
<#
.SYNOPSIS
Get the App Setting of Environment.Designation
.PARAMETER Value
[string] The appSetting value to set, if it's different than the existing file
.PARAMETER ComputerName
[string] The computer to connect to Defaults to localhost
#>
[CmdletBinding()]
param(
[Parameter(Mandatory = $true)]
[string]$Value,
[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.Designation"
Value = $Value
ComputerName = $ComputerName
}
$appSetting = Set-AppSetting @params
Write-Verbose "$logLead : ComputerName: [$ComputerName] App Setting value: [$Value]"
return $appSetting
}