PowerShell and AXModel files

In AX 2012 there is a very high chance that you have to work with the new AXModel files.

You may receive an ISV solution, or a Microsoft hotfix and you would like to know what is inside. If you have installed the management extensions, you can go to Start menu > Administrative tools > Microsoft Dynamics AX 2012 Management Shell to open PowerShell to access the AX-specific utilities.

We have a hotfix in our example, and would like to see what objects are inside, which may cause a conflict with out customizations. You can run the following command to get more details from our AXModel hotfix:

Get-AXModel -File 'D:\kb2652504.axmodel' -Details

This would return 3 array values, namely Manifest, Summary and Elements. Now to extract more information, you may specify additional criteria in the following way:

$elements = (Get-AXModel -File 'D:\kb2652504.axmodel' -Details).Elements
$elements | Select-Objects Path

The output would list all AOT objects which are within the AXModel file.

Labels: , , ,