-
-
Notifications
You must be signed in to change notification settings - Fork 5
How To Work With Model Versions
This tutorial will show you how to read and update D365FSC model versions using fscps.tools.
- PowerShell 5.1
- fscps.tools module installed
- A D365FSC metadata folder with model descriptors
Please visit the Install as a Administrator or the Install as a non-Administrator tutorials to learn how to install the tools.
Import-Module -Name fscps.tools
Use Get-FSCPSModelVersion to read the current version of a model from its descriptor file. You only need to specify the model folder — the cmdlet will automatically find the descriptor XML inside the Descriptor subfolder.
Get-FSCPSModelVersion -ModelPath "c:\temp\PackagesLocalDirectory\MyCustomModel"
This will return an object with:
- ModelName — the name of the model
-
Version — the full version string (e.g.
2.1.5.0) -
Layer — the model layer (e.g.
ISV,VAR,CUS)
$metadataPath = "c:\temp\PackagesLocalDirectory"
Get-ChildItem -Path $metadataPath -Directory | ForEach-Object {
$versionInfo = Get-FSCPSModelVersion -ModelPath $_.FullName
if ($versionInfo) {
Write-Host "$($versionInfo.ModelName) - Version: $($versionInfo.Version) - Layer: $($versionInfo.Layer)"
}
}
Use Update-FSCPSModelVersion to change the version of one or more models. This is useful in CI/CD pipelines to stamp build numbers into the model metadata before compilation.
Parameters:
- xppSourcePath — path to the root metadata folder
-
xppDescriptorSearch — search pattern for the model descriptor (e.g.
MyModel\Descriptor\*.xml) -
xppLayer — minimum layer to update (e.g.
ISVwill update ISV and above) -
versionNumber — the new version in
#.#.#.#format
Update-FSCPSModelVersion `
-xppSourcePath "c:\temp\PackagesLocalDirectory" `
-xppDescriptorSearch "MyCustomModel\Descriptor\*.xml" `
-xppLayer "ISV" `
-versionNumber "2.1.6.0"
$metadataPath = "c:\temp\PackagesLocalDirectory"
$buildVersion = "3.0.$(Get-Date -Format 'yyMM').$(Get-Date -Format 'ddHH')"
# Update all models at ISV layer and above
Get-ChildItem -Path $metadataPath -Directory | ForEach-Object {
$descriptorPattern = "$($_.Name)\Descriptor\*.xml"
Update-FSCPSModelVersion `
-xppSourcePath $metadataPath `
-xppDescriptorSearch $descriptorPattern `
-xppLayer "ISV" `
-versionNumber $buildVersion
}
In this tutorial we showed you how to:
-
Read model versions using
Get-FSCPSModelVersion -
Update model versions using
Update-FSCPSModelVersion
These cmdlets are especially useful in automated build pipelines to track and stamp version numbers into your D365FSC models.
- Install as a non-Administrator
- Install as a Administrator
- Import fscps.tools module
- List available commands from fscps.tools module
- Get help content for a command
- Get D365FSC versions data
- Compile ISV model
- Invoke Choco
- Download FSC NuGets
- Download System Update Package
- Sign Files (DigiCert / Azure KeyVault)
- Work with Model Versions
- Work with ADO Test Cases