ContainerHandling/Copy-ITICSideControlsFromContainer.ps1

<#
.SYNOPSIS
  Installs and copy all DLLs from the container so CSIDE client is able to compile all objects
.DESCRIPTION
  Long description
.EXAMPLE
  Copy-ITICSideControlsFromContainer -ContainerName bcserver
  Runs the command for container "bcserver"
.INPUTS
  ContainerName - Name of the container we want to run the command for
#>


function Copy-ITICSideControlsFromContainer {
  [CmdletBinding()]
  param (
    [Parameter(Mandatory=$true)]
    [string]$ContainerName
  )

  $Version = ((Get-BcContainerNavVersion -containerOrImageName $ContainerName).Split("-"))[0]
  $MajorVersion = ($Version.Split("."))[0]
  $MajorVersionDirectoryName = $MajorVersion + "0"

  msiexec.exe /i "C:\bcartifacts.cache\onprem\$Version\platform\Prerequisite Components\Open XML SDK 2.5 for Microsoft Office\OpenXMLSDKv25.msi" /quiet
  Copy-Item -Path "C:\bcartifacts.cache\onprem\$Version\platform\ServiceTier\program files\Microsoft Dynamics NAV\$MajorVersionDirectoryName\Service\Add-ins\*" -Destination "$env:ProgramData\BcContainerHelper\Extensions\$ContainerName\Program Files\$MajorVersionDirectoryName\RoleTailored Client\Add-ins\" -Recurse -Force
  
}

Export-ModuleMember -Function Copy-ITICSideControlsFromContainer