An interesting question pops out yesterday: with Dynamics 365 Business Central on-premise, how can I programmatically check if a particular extension is installed or not?
The standard Powershell command (in the Microsoft.Dynamics.Nav.Apps.Management module) that gets informations about an extension in a specified Business Central Server instance is the Get-NAVAppInfo cmdlet (more info about it here).
Here I’ve executed Get-NAVAppInfo on one of my Dynamics 365 Business Central on-premise instances in order to check the status of a particular app:
$ServerInstance = "MyServerInstance" $AppName = "Intelligent Cloud Base" Get-NAVAppInfo -ServerInstance $ServerInstance -Name $AppName
The output is as follows:
As you can see, there’s no the status of the extension (if it’s installed, synced, published or not in this tenant).
If you want to retrieve the status details about a particular extension, you need to execute the Get-NAVAppInfo cmdlet with the -TenantSpecificProperties parameter.
If you run the following Powershell command:
Get-NAVAppInfo -Tenant default -ServerInstance $ServerInstance -Name $AppName -TenantSpecificProperties
the output now is as follows:
Now you have all the extension’s status details and you can take actions accordingly.