New Project
A new project is created by scaffolding or generating a set of PowerShell scripts and files to create and maintain your packages.
The scaffolding output depends on the specified input parameters, in later steps we will also modify the files and customize them to fit your requirements.
In case the scripts or the steps in this guide do not suit your processes or the customer requirements you can use them as a basis to customize them even further and/or use the LSPackageTools.
Open a PowerShell session as an administrator and install the LSPackageTools:
PS C:\> Import-Module UpdateService PS C:\> Install-UscPackage -Id 'ls-package-tools'
Warning
The tools become available in the next PowerShell session you open.
Open PowerShell ISE (from the Windows Start Menu) and copy the following script into a new script:
Click the Windows Start Button -> Right-click on Windows PowerShell ISE -> Run as administrator.
$ErrorActionPreference = 'stop'; Import-Module LsPackageTools\ProjectScaffolding $Arguments = @{ OutputDir = 'c:\LS Retail\My Project' Type = 'Files' Name = 'Cronus' PackageIdPrefix = 'cronus' LsCentralVersion = '18.0' Localization = 'W1' } Invoke-ProjectScaffolding @Arguments
Before we run the script, we need to modify the input arguments with the ones that suit your requirements. The specific parameters are:
OutputDir
: Specify the output directory to generate the files.Type
: Specify the type of scripts to generate, available choices are:- Files: You provide the necessary files to create the database and object packages.
- ExtractFromDatabase: Database backup for POS devices is extracted from your maintained database, including objects and symbols.
- MaintainDatabase: Use Update Service to install a POS Master and keep it up-to-date.
- HybridCloudComponents: Same as MaintainDatabase, but with the added configuration for Hybrid Cloud Components setup.
Name
: Specify the name of your customer, this will be part of the package names created within the project.PackageIdPrefix
: Specify a package ID prefix, no special characters are allowed and use a hyphen (-) instead of spaces. This will be part of the package IDs.LsCentralVersion
: Specify the LS Central version you want your POS devices based on.Localization
: Specify the localization you want to base your POS devices on, such as W1, NA, IS, DK, ...Other available parameters:
BcPlatformVersion
: Specify the Business Central Platform version to base your POS devices on.BcAppVersion
: Specify the Business Central Application version to base your POS devices on.DbConnectionString
: Database connection string (Required when type = ExtractFromDatabase).
Run the script, click Debug -> Run/Continue in PowerShell ISE.
- This will create a set of files specified by the
OutputDir
argument, 'C:\LS Retail\My Project'. In later steps, these files will be used to create your customer-specific packages.
- This will create a set of files specified by the
Open a PowerShell Console
Open a PowerShell ISE window, as an administrator, with your project directory selected.
- Click the Windows Start Button -> Right-click on Windows PowerShell (or Windows PowerShell ISE) -> Run as administrator.
In the PowerShell console change the directory to your project directory (ie. c:\LS Retail\My Project as shown in the example above.):
PS C:\> cd "C:\LS Retail\My Project" PS C:\LS Retail\My Project>
- In later steps, this PowerShell window will be used to run the PowerShell scripts in the project directory.