web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Answered

How to build the D365FO model using powershell script?

(0) ShareShare
ReportReport
Posted on by 3,732

Hello,

Is there any possibility where we can build the D365 model using powershell script?

I have the same question (0)
  • Blue Wang Profile Picture
    Microsoft Employee on at

    Hi Sathish,

    Please read this Doc:

    docs.microsoft.com/.../version-models-build

    Note: moved to Finance forum

  • Sathish Sivakumar Profile Picture
    3,732 on at

    Hello Blue Wang,

    Thanks for the steps to setup the powershell script.

    But I need script to run model build.

    Thanks

    Sathish

  • Suggested answer
    Martin Dráb Profile Picture
    240,333 Most Valuable Professional on at

    Consider using d365fo.tools. They contains cmdlets such as Invoke-D365ModuleCompile and Invoke-D365FullModuleCompile.

    You can use command lines applications such as xppc.exe directly, but d365fo.tools makes it easier.

  • Verified answer
    Mansour Yahya Mohamad Profile Picture
    Microsoft Employee on at

    Hi Sathish,

    I have tested the below and it works fine for me. Modify according to your (Folders & Model name), save the code, open PowerShell prompt as admin and run...

    param (
    [switch]
    $Incremental,
    [switch]
    $Ref,
    [string]
    $Metadata = "K:\AOSService\PackagesLocalDirectory",
    [string]
    $CompilerMetadata = "K:\AOSService\PackagesLocalDirectory",
    [string]
    $XRefSqlServer = "localhost",
    [string]
    $XRefDbName = "DYNAMICSXREFDB",
    [string]
    $ModelModule = "ExtensionModel",
    [string]
    $OutPut = "K:\AOSService\PackagesLocalDirectory\ExtensionModel\bin",
    [string]
    $XmlLog = "K:\AOSService\PackagesLocalDirectory\ExtensionModel\BuildProjectResult.xml",
    [string]
    $Log = "K:\AOSService\PackagesLocalDirectory\ExtensionModel\BuildProjectResult.log",
    [string]
    $AppBase = "K:\AOSService\PackagesLocalDirectory\bin",
    [string]
    $RefPath = "K:\AOSService\PackagesLocalDirectory\ExtensionModel\bin",
    [string]
    $ReferenceFolder = "K:\AOSService\PackagesLocalDirectory",

    [string]
    $ApplicationPath = "K:\AOSService\PackagesLocalDirectory\bin\xppc.exe"
    )
    $arguments = @(
    " -metadata=`"$Metadata`""
    " -compilermetadata=`"$CompilerMetadata`""
    " -xrefSqlServer=`"$XRefSqlServer`""
    " -xrefDbName=`"$XRefDbName`""
    " -modelModule=`"$ModelModule`""
    " -output=`"$OutPut`""
    " -xmllog=`"$XmlLog`""
    " -log=`"$Log`""
    " -appBase=`"$AppBase`""
    " -refPath=`"$RefPath`""
    " -referenceFolder=`"$ReferenceFolder`""
    )
    if ($Incremental) { $arguments += '-incremental' }
    if ($Ref) { $arguments += '-xref' }
    Start-Process -FilePath $ApplicationPath -ArgumentList $arguments -Wait -NoNewWindow

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 286 Super User 2026 Season 2

#2
SajeedMullaji Profile Picture

SajeedMullaji 272

#3
Martin Dráb Profile Picture

Martin Dráb 258 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans