function Set-EnvironmentHosting { <# .SYNOPSIS Get the App Setting of Environment.Hosting .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.Hosting" Value = $Value ComputerName = $ComputerName } $appSetting = Set-AppSetting @params Write-Verbose "$logLead : ComputerName: [$ComputerName] App Setting value: [$Value]" return $appSetting }