Converting Dynamics NAV source code from C/AL to AL using PowerShell

Converting from C/AL to AL can be a bit of a hassle:

  • First you need to open den Development Environment
  • Then filter the objects that needs converting
  • Export the objects to a txt file in a folder
  • Then Run the Txt2AL.exe
  • Lastly import them in the workspace

So, I thought: Why cannot I do that directly from VS Code with PowerShell?

Searching the Internet, it seems that a lot of other people have struggled with the same issue so I decided to compile a PowerShell script that can be run directly from VS Code.

This should work:

 

Just remember:

  • start VS Code as administrator
  • load the PowerShell extension.
  • Create a couple of folders
    • c:\temp
    • c:\temp\AL-Conversion
    • c:\temp\AL-Conversion\cal
    • c:\temp\AL-Conversion\al

And of course, change the connection details and filters.

Then just mark the code and press F8 to run the code.

The Script can be downloaded here:

http://ba-consult.dk/downloads/Convert_CAL_AL.zip

 

As usual, use at own risk [:)]

 

Anonymous
Related