Skip to main content

Install Extension (App)

The script imports the Microsoft.BusinessCentral.Apps.Management.dll module, which provides the cmdlets that are used to manage apps.

info

Before running the script please fill out the variables

  • $NSTFolderPath: the path to the folder containing the Microsoft Dynamics 365 Business Central server instance
  • $ServerInstance: the name of the Business Central server instance
  • $NewAppPath: the path of the .app file for the new version of the extension

And also, the script assumes that the user running the script has the necessary permissions to perform the above actions.

Please make sure that the variables are set correctly before running the script and that you have the correct version of the app package and that the path to the package is valid.

#--------------------PRE STEP-------------------------------
$NSTFolderPath = "";
$ServerInstance = "";
$NewAppPath = "";
#-------------------------------DO NOT EDIT UNDER THIS LINE-------------------------------
Import-Module (Join-Path $NSTFolderPath "Admin\Microsoft.BusinessCentral.Apps.Management.dll");

$NewAppInfo = Get-NAVAppInfo -Path $NewAppPath;
$NewVersion = $NewAppInfo.Version;

Publish-NAVApp -ServerInstance $ServerInstance -Path $NewAppPath -SkipVerification;
Sync-NAVApp -ServerInstance $ServerInstance -AppId $NewAppInfo.AppId -Version $NewVersion;
Install-NAVApp -ServerInstance $ServerInstance -AppId $NewAppInfo.AppId -Version $NewVersion;