Powershell scripts to improve quality of life for AL developers
You need to run this only once.
- Open Powershell
- Run
$profile. This will create a Powershell profile file.
- Open Powershell and run
code $profile - Include scripts like this:
. .\<path to repo>\CloneRepo.ps1. - Check the documentation below to see if you need to make additional changes.
- Restart Powershell to reload the profile
This scripts collects the IDs of the AL objects in the app, divides it into ranges and outputs a JSON-snippet that can be copied to the app.json key idRanges.
Usage: run GetRanges from a /app or /test directory. Then copy the JSON-snippet to the app.json
- Open Powershell in the
/appor/testfolder. - Create a
new-names.csvfile in the current directory. It should contain two columns:old(current file name) andnew(desired file name). - Run
renamefilesto rename the files.
This scripts automates the creation of a local dev environment, based on the ticket no you're going to work on.
This scripts needs to know where to clone the repo's. Follow these steps to add the required parameter to your PS profile.
- Run command 'code `$profile'
- Add this line to the top of the file:
$global:DEV_ROOT = 'C:\dev\...';Replace the path with the full path to the root directory of your AL projects - Restart Powershell/Terminal.
This script retrieves the repo's from the 4PS_NL project in DevOps.
- In Azure DevOps, go to User Settings > Personal Access Tokens > New Token.
- Name: choose something
- Expiration: set to end of this year
- Scopes: choose
Custom defined. Then chooseReadunder sectionCode - Click Create and copy token.
- In Windows, go to Credential Manager > Windows Credentials > Add a generic credential
- Internet or network address:
devops - Username:
devops - Password: the pat
Usage: run cr from anywhere to start this process