Containers/Enable-SymbolLoading.ps1

function Enable-SymbolLoading {
    Param(
        [Parameter(Mandatory=$false)]
        $ContainerName = "",
        [Parameter(Mandatory=$false)]
        $SourcePath = (Get-Location)
    )

    if ($ContainerName -eq "") {
        $ContainerName = Get-ContainerFromLaunchJson
    }

    [version]$platform = Get-AppKeyValue -SourcePath $SourcePath -KeyName 'platform'
    if ($platform.Major -gt 11) {
        throw "You can only enable symbols for NAV 2018"
    }

    Invoke-ScriptInNavContainer -containerName $ContainerName -scriptblock { 
        Set-NavServerConfiguration -ServerInstance NAV -KeyName 'EnableSymbolLoadingAtServerStartup' -KeyValue $true
        Set-NavServerInstance -ServerInstance NAV -Restart
    }
}
Export-ModuleMember Enable-SymbolLoading