Containers/Disable-SymbolLoading.ps1

<#
 .Synopsis
  Disables symbol loading in container
 .Description
  Disables symbol loading in container
 .Parameter ContainerName
  Name of the container. Can be provided in the settings.json
 .Parameter SourcePath
  Path to the current project
 .Example
  Disable-SymbolLoading
#>

function Disable-SymbolLoading {
    Param(
        [Parameter(Mandatory=$false)]
        $ContainerName = ""
    )

    $ContainerName = Get-NewContainerName -ContainerName $ContainerName

    $platform = Get-PlatformFromContainer -ContainerName $ContainerName
    if ($platform.Major -gt 11 -and $platform.Major -ne 14) {
        throw "You can only enable symbols for NAV 2018 and BC 14"
    }

    Invoke-ScriptInBcContainer -containerName $ContainerName -scriptblock {
        Set-NavServerConfiguration -ServerInstance NAV -KeyName 'EnableSymbolLoadingAtServerStartup' -KeyValue $false
        Set-NavServerInstance -ServerInstance NAV -Restart
    }
}