Private/ps1/Set-ApprxrFileWatcherLocationEntry.ps1

<##
.SYNOPSIS
    Adds or updates a file watcher location entry in the Apprxr configuration.
.DESCRIPTION
    Adds or updates a location entry by name in the 'FileWatcher' configuration value, encoding the full set back to JSON.
.PARAMETER Name
    The unique name for this location setting (used as the configuration key).
.PARAMETER LocationConfig
    The hashtable containing location settings (InputFolder, VdbName, InProgressFolder).
.EXAMPLE
    Set-ApprxrFileWatcherLocationEntry -Name 'Location1' -LocationConfig $config
    Adds or updates the entry for 'Location1'.
##>

function Set-ApprxrFileWatcherLocationEntry {
    param(
        [Parameter(Mandatory)]
        [string]$Name,
        [Parameter(Mandatory)]
        [hashtable]$LocationConfig
    )
    $locations = Get-ApprxrFileWatcherLocations
    $locations[$Name] = $LocationConfig
    $json = $locations | ConvertTo-Json -Depth 5
    Set-ApprxrConfigurationValue -Name 'FileWatcher' -Value $json
}