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

Notifications

Announcements

No record found.

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
    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
    237,801 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
    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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

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

#1
Martin Dráb Profile Picture

Martin Dráb 664 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 522 Super User 2025 Season 2

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 303 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans