-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
I tried setting this up with the URI being set as Enabled: False and it errors out. I think I see the issue, the enabled value isn't being checked/used at all in this block. It is checked/set in Get-ChWebServiceEnabled, but that is only used in the logging. Also, the other 2 values in webService don't look at enabled at all anywhere (and UseAPIConfig isnt used at all in any of it, maybe thats a "someday" feature, not sure).
$GetConfigFromAPI = Get-ChWebServiceUseConfigFromApi
if ($GetConfigFromAPI) {
$WebApiUrl = Get-ChWebServiceUri
$WebApiKey = Get-ChWebServiceApiKey
try {
$configText = Get-ConfigFromWebservice -URI $WebApiUrl -ApiKey $WebApiKey -ErrorAction Stop
$json = $configText
}
catch {
write-Error $_
Exit 1
}
try {
$configJsonString = ConvertTo-Json $configText
Out-File -FilePath $ConfigFilePath -InputObject $configJsonString -ErrorAction Stop
}
catch{
Write-Warning "Failed to write updated Configuration locally to file: $ConfigFilePath"
}
}
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels