Skip to content

webservice: Enable not being used/checked #1

@BrewNinja

Description

@BrewNinja

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"
    }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions