How to export the Business Central Extension Details in different file formats using Windows Powershell

SaranBusiness Central5 years ago17 Views

Previously, we had gone through a blog on Viewing the Object Details of Business Central Extensions. Now, let’s explore to export the Extension details, generally the information available in the app.json of the extension created using Windows Powershell into formats like Html or Excel format.

In order to export the extension details, let’s go to Windows Powershell (Run as administrator). In this process, we will be importing the Business Central Powershell script NAVAdminTool.

Firstly, we will go through the steps to export the details into HTML page. The following code converts the information into Html page and saves it in the path mentioned in the script itself.

$Header = @"
<style>
TABLE {border-width: 1px; border-style: solid; border-color: black; border-collapse: collapse;}
TH {border-width: 1px; padding: 3px; border-style: solid; border-color: black; background-color: #6495ED;}
TD {border-width: 1px; padding: 3px; border-style: solid; border-color: black;}
</style>
"@
Import-Module "C:Program FilesMicrosoft Dynamics 365 Business Central150ServiceNavAdminTool.ps1"
Write-Output 'Business Central Extension Management Details'
$ServerInstance = 'BC150'
Get-NAVAppInfo -ServerInstance $ServerInstance -Name $ServerInstance
$string = Get-NAVAppInfo
$string | Get-NAVAppInfo | ConvertTo-Html -Property ID,Name,Version,Publisher,ExtensionType,Scope,Brief,Description,Dependencies,PackageID -Head $Header | Out-File D:PowerShellProcess16.html
Powershell script : Convert to Html

Now, Run Script (F5) and check the Output path mentioned in the script (Out-File). The File will be generated.

Html Output

We can see the html page opened in the browser displaying details including Version and Package ID.

Let’s approach Excel output generation as follows:

Import-Module "C:Program FilesMicrosoft Dynamics 365 Business Central150ServiceNavAdminTool.ps1"
$string = Get-NAVAppInfo
$string | Get-NAVAppInfo | 
Select-Object ServerInstance, Name, Publisher, Scope, AppID, PackageID, Brief, Description, DeveloperTenantId, Dependencies | 
Export-Csv -Path D:PowerShelloutput1125.csv
Powershell script to Export to Excel
Export to Excel

This approach is to provide assistance on exporting all the details related to overall extensions published in an instance at one go.

⭐⭐⭐⭐


























Rating: 3.5 out of 5.

Original Post https://codethecoffee.wordpress.com/2019/12/12/how-to-export-the-business-central-extension-details-in-different-file-formats-using-windows-powershell/

0 Votes: 0 Upvotes, 0 Downvotes (0 Points)

Leave a reply

Join Us
  • X Network2.1K
  • LinkedIn3.8k
  • Bluesky0.5K
Support The Site
Events
March 2025
MTWTFSS
      1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
31       
« Feb   Apr »
Follow
Sign In/Sign Up Sidebar Search
Popular Now
Loading

Signing-in 3 seconds...

Signing-up 3 seconds...