The Compile-AXCIL custom PowerShell function will allow you to generate the AX CIL. This doesn’t add anything really new to what is existing, as the DynamicsAXCommunity PowerShell module has a Compile-AXIL function. I have only re-written this because of my desire to allow emails to be sent from these functions.
The Compile-AXCIL function takes between 1 and 7 parameters:
- ConfigPath (Client configuration for the chosen AX environment)
- LogFile (The value defaults to the temp folder but can be overridden if desired)
- TimeOut (The value defaults to 2 hours but can be overridden if desired)
- SMTPServer (SMTP server to use to send the email)
- MailMsg (Net.Mail.MailMessage object used to send the email)
- Version (The AX version. It defaults to 6.)
- VariablePath (Path to a file used to default the parameters/variables)
I use the VariablePath parameter the same way that I do in the other functions I’ve posted that use it. This function can be found in Codeplex. The steps of this function are:
- Load the variables if a VariablePath parameter is used
- Get the AX environment info using Get-AXConfig
- Get the CompileIL AX AutoRun xml using the Get-AXAutoRunXML function
- Call the Start-AXAutoRun function to compile the IL
This function should also only be run on the AOS server. It has been tested using AX 2012 R2 CU7 but should also work for R3.