function Set-BNMConfig {
        Set the default configuration for Banca Nationala of Moldova.

        Set the default configuration for BNM server. Convert parameter values to object and write to the JSON configuration file.

        .PARAMETER Endpoint
        The URI endpoint that will be utilized.

        .PARAMETER Params
        The params that will be appended to the URI.
        Set-BNMConfig -Endpoint "" -Params "@{get_xml = 1; date = '01.01.2020'}"
        Sets the default addr to "" with query param "get_xml=1&date=01.01.2020".

        Set-BNMConfig -Endpoint "https://localhost/get_currency"
        Used in case of proxy-ing results via nginx or alternative proxy.
        Also can be used in test environments.
        Sets the default addr to "localhost" without query param.



    try {
        Write-Verbose -Message 'Trying Get-BNMConfig before Set-BNMConfig.'
        $config = Get-Content -Path "$PSScriptRoot\config.json" -ErrorAction 'Stop' |
        Write-Verbose -Message 'Stored config.json found.'
    } catch {
        Write-Verbose -Message 'No configuration found - starting with default configuration.'
        $config = @{
            bnm = @{
                endPoint = ""; 
                    @{date="`$(get-date -f 'dd.MM.yyyy')"}

    if ($Endpoint) {$config.bnm.endpoint = $Endpoint}
    if ($Params) {$config.bnm.params = $Params}

    Write-Verbose -Message 'Setting config.json.'
    $config |
        ConvertTo-Json -Depth 99 |
            Set-Content -Path "$PSScriptRoot\config.json"