From a9ca4f8418d25b6775dacbffcd373a9a9d9767f5 Mon Sep 17 00:00:00 2001 From: Florian Hopfner Date: Sat, 22 Feb 2025 13:38:54 +0000 Subject: [PATCH 1/3] separate out retail components from fallback service models fixes #878 --- .../functions/invoke-d365sdpinstall.ps1 | 16 ++++++++++++--- .../functions/update-topologyfile.ps1 | 20 +++++++++++++++++-- d365fo.tools/internal/scripts/variables.ps1 | 9 +++++++-- 3 files changed, 38 insertions(+), 7 deletions(-) diff --git a/d365fo.tools/functions/invoke-d365sdpinstall.ps1 b/d365fo.tools/functions/invoke-d365sdpinstall.ps1 index 18afa5ea..1847fbdc 100644 --- a/d365fo.tools/functions/invoke-d365sdpinstall.ps1 +++ b/d365fo.tools/functions/invoke-d365sdpinstall.ps1 @@ -71,6 +71,14 @@ .PARAMETER UnifiedDevelopmentEnvironment Use this switch to install the package in a Unified Development Environment (UDE). + + .PARAMETER IncludeFallbackRetailServiceModels + Include fallback retail service models in the topology file + + This parameter is to support backward compatibility in this scenario: + Installing the first update on a local VHD where the information about the installed service + models may not be available and where the retail components are installed. + More information about this can be found at https://github.com/d365collaborative/d365fo.tools/issues/878 .EXAMPLE PS C:\> Invoke-D365SDPInstall -Path "c:\temp\package.zip" -QuickInstallAll @@ -171,7 +179,9 @@ function Invoke-D365SDPInstall { [switch] $UseExistingTopologyFile, [Parameter(ParameterSetName = 'UDEInstall')] - [switch] $UnifiedDevelopmentEnvironment + [switch] $UnifiedDevelopmentEnvironment, + + [switch] $IncludeFallbackRetailServiceModels ) if ($UnifiedDevelopmentEnvironment) { @@ -260,7 +270,7 @@ function Invoke-D365SDPInstall { #Update topology file (first command) if (-not $UseExistingTopologyFile) { - $ok = Update-TopologyFile -Path $Path -TopologyFile $TopologyFile + $ok = Update-TopologyFile -Path $Path -TopologyFile $TopologyFile -IncludeFallbackRetailServiceModels:$IncludeFallbackRetailServiceModels if (-not $ok) { Write-PSFMessage -Level Warning "Failed to update topology file." return @@ -310,7 +320,7 @@ function Invoke-D365SDPInstall { Write-PSFMessage -Level Warning "The SetTopology command is used to update a topology file. The UseExistingTopologyFile switch should not be used with this command." return } - $ok = Update-TopologyFile -Path $Path -TopologyFile $TopologyFile + $ok = Update-TopologyFile -Path $Path -TopologyFile $TopologyFile -IncludeFallbackRetailServiceModels:$IncludeFallbackRetailServiceModels if (-not $ok) { Write-PSFMessage -Level Warning "Failed to update topology file." } diff --git a/d365fo.tools/internal/functions/update-topologyfile.ps1 b/d365fo.tools/internal/functions/update-topologyfile.ps1 index e712b918..d6a8ac6f 100644 --- a/d365fo.tools/internal/functions/update-topologyfile.ps1 +++ b/d365fo.tools/internal/functions/update-topologyfile.ps1 @@ -15,6 +15,14 @@ Path to the topology file to update If not specified, the default topology file will be used + + .PARAMETER IncludeFallbackRetailServiceModels + Include fallback retail service models in the topology file + + This parameter is to support backward compatibility in this scenario: + Installing the first update on a local VHD where the information about the installed service + models may not be available and where the retail components are installed. + More information about this can be found at https://github.com/d365collaborative/d365fo.tools/issues/878 .EXAMPLE PS C:\> Update-TopologyFile -Path "c:\temp\UpdatePackageFolder" -TopologyFile "c:\temp\d365fo.tools\DefaultTopologyData.xml" @@ -36,7 +44,9 @@ function Update-TopologyFile { [Parameter(Mandatory = $true)] [string]$Path, - [string]$TopologyFile + [string]$TopologyFile, + + [switch]$IncludeFallbackRetailServiceModels ) if (-not $TopologyFile) { @@ -62,7 +72,13 @@ function Update-TopologyFile { if ($null -eq $models -or $models.Count -eq 0) { Write-PSFMessage -Level Warning "No installed service models found." Write-PSFMessage -Level Output "Using fallback list of known service model names." - $serviceModelNames = $Script:FallbackInstallationServiceModelNames + $serviceModelNames = $Script:FallbackInstallationCoreServiceModelNames + if ($IncludeFallbackRetailServiceModels) { + $serviceModelNames += $Script:FallbackInstallationRetailServiceModelNames + } + else { + Write-PSFMessage -Level Output "The fallback list of known service model names does not include the retail service models. To include them, use the -IncludeFallbackRetailServiceModels switch. See https://github.com/d365collaborative/d365fo.tools/issues/878 for more information." + } $models = $serviceModelNames | ForEach-Object { [PSCustomObject]@{ Name = $_ diff --git a/d365fo.tools/internal/scripts/variables.ps1 b/d365fo.tools/internal/scripts/variables.ps1 index e0b423d0..a2710e08 100644 --- a/d365fo.tools/internal/scripts/variables.ps1 +++ b/d365fo.tools/internal/scripts/variables.ps1 @@ -102,7 +102,7 @@ $Script:InstallationRecordsDir = $RegValue # On a local VHD, the information about the installed service models may not be available. # As a fallback, this list of known service model names may be used. -$Script:FallbackInstallationServiceModelNames = @( +$Script:FallbackInstallationCoreServiceModelNames = @( "ALMService", "AOSService", "BIService", @@ -111,7 +111,12 @@ $Script:FallbackInstallationServiceModelNames = @( "MROneBox", "PayrollTaxModule", "PerfSDK", - "ReportingService", + "ReportingService" +) +# Starting with version 10.0.41, Microsoft has released VHD images without the retail components +# preinstalled. The retail components are only included in the fallback list if the user +# explicitly requests it. +$Script:FallbackInstallationRetailServiceModelNames = @( "RetailCloudPos", "RetailHQConfiguration", "RetailSDK", From 5351bd861cace6866d07169df5d20b7ce5b7d7fb Mon Sep 17 00:00:00 2001 From: Florian Hopfner Date: Sat, 22 Feb 2025 15:01:14 +0000 Subject: [PATCH 2/3] add example for new parameter -IncludeFallbackRetailServiceModels --- d365fo.tools/functions/invoke-d365sdpinstall.ps1 | 9 ++++++++- d365fo.tools/internal/functions/update-topologyfile.ps1 | 2 +- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/d365fo.tools/functions/invoke-d365sdpinstall.ps1 b/d365fo.tools/functions/invoke-d365sdpinstall.ps1 index 1847fbdc..8690fd20 100644 --- a/d365fo.tools/functions/invoke-d365sdpinstall.ps1 +++ b/d365fo.tools/functions/invoke-d365sdpinstall.ps1 @@ -76,7 +76,7 @@ Include fallback retail service models in the topology file This parameter is to support backward compatibility in this scenario: - Installing the first update on a local VHD where the information about the installed service + Installing the first update on a local VHD where the information about the installed service models may not be available and where the retail components are installed. More information about this can be found at https://github.com/d365collaborative/d365fo.tools/issues/878 @@ -129,6 +129,13 @@ PS C:\> Invoke-D365SDPInstall -Path "c:\temp\" -MetaDataDir "c:\MyRepository\Metadata" -UnifiedDevelopmentEnvironment Install the modules contained in the c:\temp\ directory into the c:\MyRepository\Metadata directory. + + .EXAMPLE + Invoke-D365SDPInstall -Path "c:\temp\" -Command RunAll -IncludeFallbackRetailServiceModels + + Create Topology XML from current environment. If the current environment does not have the information about the installed service models, a fallback list of known service model names will be used. + This fallback list includes the retail service models. + Using default runbook id 'Runbook' and run all the operations from generate, to import to execute. .NOTES Author: Tommy Skaue (@skaue) diff --git a/d365fo.tools/internal/functions/update-topologyfile.ps1 b/d365fo.tools/internal/functions/update-topologyfile.ps1 index d6a8ac6f..9ed62d25 100644 --- a/d365fo.tools/internal/functions/update-topologyfile.ps1 +++ b/d365fo.tools/internal/functions/update-topologyfile.ps1 @@ -20,7 +20,7 @@ Include fallback retail service models in the topology file This parameter is to support backward compatibility in this scenario: - Installing the first update on a local VHD where the information about the installed service + Installing the first update on a local VHD where the information about the installed service models may not be available and where the retail components are installed. More information about this can be found at https://github.com/d365collaborative/d365fo.tools/issues/878 From 91eac06a2f8fecc36a9a6b7e1103d2e645e3addf Mon Sep 17 00:00:00 2001 From: FH-Inway <33372796+FH-Inway@users.noreply.github.com> Date: Sat, 22 Feb 2025 15:02:56 +0000 Subject: [PATCH 3/3] =?UTF-8?q?=F0=9F=A4=96=20Fix=20best=20practice=20devi?= =?UTF-8?q?ations?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This pull request was automatically created by the d365fo.tools-Generate-Text action' --- d365fo.tools/bin/d365fo.tools-index.json | 12 +++++- .../functions/invoke-d365sdpinstall.ps1 | 8 ++-- .../functions/invoke-d365sdpinstallude.ps1 | 2 +- .../functions/update-topologyfile.ps1 | 4 +- .../functions/Invoke-D365SDPInstall.Tests.ps1 | 21 ++++++++-- docs/Invoke-D365SDPInstall.md | 39 +++++++++++++++++-- 6 files changed, 69 insertions(+), 17 deletions(-) diff --git a/d365fo.tools/bin/d365fo.tools-index.json b/d365fo.tools/bin/d365fo.tools-index.json index 5f1a61dd..09d0096b 100644 --- a/d365fo.tools/bin/d365fo.tools-index.json +++ b/d365fo.tools/bin/d365fo.tools-index.json @@ -9101,6 +9101,14 @@ false, "false", "False" + ], + [ + "IncludeFallbackRetailServiceModels", + "Include fallback retail service models in the topology file\nThis parameter is to support backward compatibility in this scenario:\r\nInstalling the first update on a local VHD where the information about the installed service\r\nmodels may not be available and where the retail components are installed.\r\nMore information about this can be found at https://github.com/d365collaborative/d365fo.tools/issues/878", + "", + false, + "false", + "False" ] ], "Alias": "", @@ -9108,8 +9116,8 @@ "Synopsis": "Install a Software Deployable Package (SDP)", "Name": "Invoke-D365SDPInstall", "Links": null, - "Examples": "-------------------------- EXAMPLE 1 --------------------------\nPS C:\\\u003eInvoke-D365SDPInstall -Path \"c:\\temp\\package.zip\" -QuickInstallAll\nThis will install the package contained in the c:\\temp\\package.zip file using a runbook in memory while executing.\n-------------------------- EXAMPLE 2 --------------------------\nPS C:\\\u003eInvoke-D365SDPInstall -Path \"c:\\temp\\\" -DevInstall\nThis will install the extracted package in c:\\temp\\ using a runbook in memory while executing.\nThis command is to be used on Microsoft Hosted Tier1 development environment, where you don\u0027t have access to the administrator user account on the vm.\n-------------------------- EXAMPLE 3 --------------------------\nPS C:\\\u003eInvoke-D365SDPInstall -Path \"c:\\temp\\\" -Command SetTopology\nPS C:\\\u003e Invoke-D365SDPInstall -Path \"c:\\temp\\\" -Command Generate -RunbookId \u0027MyRunbook\u0027\r\nPS C:\\\u003e Invoke-D365SDPInstall -Path \"c:\\temp\\\" -Command Import -RunbookId \u0027MyRunbook\u0027\r\nPS C:\\\u003e Invoke-D365SDPInstall -Path \"c:\\temp\\\" -Command Execute -RunbookId \u0027MyRunbook\u0027\nManual operations that first create Topology XML from current environment, then generate runbook with id \u0027MyRunbook\u0027, then import it and finally execute it.\n-------------------------- EXAMPLE 4 --------------------------\nPS C:\\\u003eInvoke-D365SDPInstall -Path \"c:\\temp\\\" -Command RunAll\nCreate Topology XML from current environment. Using default runbook id \u0027Runbook\u0027 and run all the operations from generate, to import to execute.\n-------------------------- EXAMPLE 5 --------------------------\nPS C:\\\u003eInvoke-D365SDPInstall -Path \"c:\\temp\\\" -Command RerunStep -Step 18 -RunbookId \u0027MyRunbook\u0027\nRerun runbook with id \u0027MyRunbook\u0027 from step 18.\n-------------------------- EXAMPLE 6 --------------------------\nPS C:\\\u003eInvoke-D365SDPInstall -Path \"c:\\temp\\\" -Command SetStepComplete -Step 24 -RunbookId \u0027MyRunbook\u0027\nMark step 24 complete in runbook with id \u0027MyRunbook\u0027 and continue the runbook from the next step.\n-------------------------- EXAMPLE 7 --------------------------\nPS C:\\\u003eInvoke-D365SDPInstall -Path \"c:\\temp\\\" -Command SetTopology -TopologyFile \"c:\\temp\\MyTopology.xml\"\nUpdate the MyTopology.xml file with all the installed services on the machine.\n-------------------------- EXAMPLE 8 --------------------------\nPS C:\\\u003eInvoke-D365SDPInstall -Path \"c:\\temp\\\" -Command RunAll -TopologyFile \"c:\\temp\\MyTopology.xml\" -UseExistingTopologyFile\nRun all manual steps in one single operation using the MyTopology.xml file. The topology file is not updated.\n-------------------------- EXAMPLE 9 --------------------------\nPS C:\\\u003eInvoke-D365SDPInstall -Path \"c:\\temp\\\" -MetaDataDir \"c:\\MyRepository\\Metadata\" -UnifiedDevelopmentEnvironment\nInstall the modules contained in the c:\\temp\\ directory into the c:\\MyRepository\\Metadata directory.", - "Syntax": "Invoke-D365SDPInstall [-Path] \u003cString\u003e [[-MetaDataDir] \u003cString\u003e] [[-QuickInstallAll]] [[-Step] \u003cInt32\u003e] [[-RunbookId] \u003cString\u003e] [-LogPath \u003cString\u003e] [-ShowOriginalProgress] [-OutputCommandOnly] [-TopologyFile \u003cString\u003e] [-UseExistingTopologyFile] [\u003cCommonParameters\u003e]\nInvoke-D365SDPInstall [-Path] \u003cString\u003e [[-MetaDataDir] \u003cString\u003e] [[-DevInstall]] [[-Step] \u003cInt32\u003e] [[-RunbookId] \u003cString\u003e] [-LogPath \u003cString\u003e] [-ShowOriginalProgress] [-OutputCommandOnly] [-TopologyFile \u003cString\u003e] [-UseExistingTopologyFile] [\u003cCommonParameters\u003e]\nInvoke-D365SDPInstall [-Path] \u003cString\u003e [[-MetaDataDir] \u003cString\u003e] [-Command] \u003cString\u003e [[-Step] \u003cInt32\u003e] [[-RunbookId] \u003cString\u003e] [-LogPath \u003cString\u003e] [-ShowOriginalProgress] [-OutputCommandOnly] [-TopologyFile \u003cString\u003e] [-UseExistingTopologyFile] [\u003cCommonParameters\u003e]\nInvoke-D365SDPInstall [-Path] \u003cString\u003e [[-MetaDataDir] \u003cString\u003e] [[-Step] \u003cInt32\u003e] [[-RunbookId] \u003cString\u003e] [-LogPath \u003cString\u003e] [-ShowOriginalProgress] [-OutputCommandOnly] [-TopologyFile \u003cString\u003e] [-UseExistingTopologyFile] [-UnifiedDevelopmentEnvironment] [\u003cCommonParameters\u003e]" + "Examples": "-------------------------- EXAMPLE 1 --------------------------\nPS C:\\\u003eInvoke-D365SDPInstall -Path \"c:\\temp\\package.zip\" -QuickInstallAll\nThis will install the package contained in the c:\\temp\\package.zip file using a runbook in memory while executing.\n-------------------------- EXAMPLE 2 --------------------------\nPS C:\\\u003eInvoke-D365SDPInstall -Path \"c:\\temp\\\" -DevInstall\nThis will install the extracted package in c:\\temp\\ using a runbook in memory while executing.\nThis command is to be used on Microsoft Hosted Tier1 development environment, where you don\u0027t have access to the administrator user account on the vm.\n-------------------------- EXAMPLE 3 --------------------------\nPS C:\\\u003eInvoke-D365SDPInstall -Path \"c:\\temp\\\" -Command SetTopology\nPS C:\\\u003e Invoke-D365SDPInstall -Path \"c:\\temp\\\" -Command Generate -RunbookId \u0027MyRunbook\u0027\r\nPS C:\\\u003e Invoke-D365SDPInstall -Path \"c:\\temp\\\" -Command Import -RunbookId \u0027MyRunbook\u0027\r\nPS C:\\\u003e Invoke-D365SDPInstall -Path \"c:\\temp\\\" -Command Execute -RunbookId \u0027MyRunbook\u0027\nManual operations that first create Topology XML from current environment, then generate runbook with id \u0027MyRunbook\u0027, then import it and finally execute it.\n-------------------------- EXAMPLE 4 --------------------------\nPS C:\\\u003eInvoke-D365SDPInstall -Path \"c:\\temp\\\" -Command RunAll\nCreate Topology XML from current environment. Using default runbook id \u0027Runbook\u0027 and run all the operations from generate, to import to execute.\n-------------------------- EXAMPLE 5 --------------------------\nPS C:\\\u003eInvoke-D365SDPInstall -Path \"c:\\temp\\\" -Command RerunStep -Step 18 -RunbookId \u0027MyRunbook\u0027\nRerun runbook with id \u0027MyRunbook\u0027 from step 18.\n-------------------------- EXAMPLE 6 --------------------------\nPS C:\\\u003eInvoke-D365SDPInstall -Path \"c:\\temp\\\" -Command SetStepComplete -Step 24 -RunbookId \u0027MyRunbook\u0027\nMark step 24 complete in runbook with id \u0027MyRunbook\u0027 and continue the runbook from the next step.\n-------------------------- EXAMPLE 7 --------------------------\nPS C:\\\u003eInvoke-D365SDPInstall -Path \"c:\\temp\\\" -Command SetTopology -TopologyFile \"c:\\temp\\MyTopology.xml\"\nUpdate the MyTopology.xml file with all the installed services on the machine.\n-------------------------- EXAMPLE 8 --------------------------\nPS C:\\\u003eInvoke-D365SDPInstall -Path \"c:\\temp\\\" -Command RunAll -TopologyFile \"c:\\temp\\MyTopology.xml\" -UseExistingTopologyFile\nRun all manual steps in one single operation using the MyTopology.xml file. The topology file is not updated.\n-------------------------- EXAMPLE 9 --------------------------\nPS C:\\\u003eInvoke-D365SDPInstall -Path \"c:\\temp\\\" -MetaDataDir \"c:\\MyRepository\\Metadata\" -UnifiedDevelopmentEnvironment\nInstall the modules contained in the c:\\temp\\ directory into the c:\\MyRepository\\Metadata directory.\n-------------------------- EXAMPLE 10 --------------------------\nPS C:\\\u003eInvoke-D365SDPInstall -Path \"c:\\temp\\\" -Command RunAll -IncludeFallbackRetailServiceModels\nCreate Topology XML from current environment. If the current environment does not have the information about the installed service models, a fallback list of known service model names will be used.\r\nThis fallback list includes the retail service models.\r\nUsing default runbook id \u0027Runbook\u0027 and run all the operations from generate, to import to execute.", + "Syntax": "Invoke-D365SDPInstall [-Path] \u003cString\u003e [[-MetaDataDir] \u003cString\u003e] [[-QuickInstallAll]] [[-Step] \u003cInt32\u003e] [[-RunbookId] \u003cString\u003e] [-LogPath \u003cString\u003e] [-ShowOriginalProgress] [-OutputCommandOnly] [-TopologyFile \u003cString\u003e] [-UseExistingTopologyFile] [-IncludeFallbackRetailServiceModels] [\u003cCommonParameters\u003e]\nInvoke-D365SDPInstall [-Path] \u003cString\u003e [[-MetaDataDir] \u003cString\u003e] [[-DevInstall]] [[-Step] \u003cInt32\u003e] [[-RunbookId] \u003cString\u003e] [-LogPath \u003cString\u003e] [-ShowOriginalProgress] [-OutputCommandOnly] [-TopologyFile \u003cString\u003e] [-UseExistingTopologyFile] [-IncludeFallbackRetailServiceModels] [\u003cCommonParameters\u003e]\nInvoke-D365SDPInstall [-Path] \u003cString\u003e [[-MetaDataDir] \u003cString\u003e] [-Command] \u003cString\u003e [[-Step] \u003cInt32\u003e] [[-RunbookId] \u003cString\u003e] [-LogPath \u003cString\u003e] [-ShowOriginalProgress] [-OutputCommandOnly] [-TopologyFile \u003cString\u003e] [-UseExistingTopologyFile] [-IncludeFallbackRetailServiceModels] [\u003cCommonParameters\u003e]\nInvoke-D365SDPInstall [-Path] \u003cString\u003e [[-MetaDataDir] \u003cString\u003e] [[-Step] \u003cInt32\u003e] [[-RunbookId] \u003cString\u003e] [-LogPath \u003cString\u003e] [-ShowOriginalProgress] [-OutputCommandOnly] [-TopologyFile \u003cString\u003e] [-UseExistingTopologyFile] [-UnifiedDevelopmentEnvironment] [-IncludeFallbackRetailServiceModels] [\u003cCommonParameters\u003e]" }, { "CommandName": "Invoke-D365SDPInstallUDE", diff --git a/d365fo.tools/functions/invoke-d365sdpinstall.ps1 b/d365fo.tools/functions/invoke-d365sdpinstall.ps1 index 8690fd20..5f6195d8 100644 --- a/d365fo.tools/functions/invoke-d365sdpinstall.ps1 +++ b/d365fo.tools/functions/invoke-d365sdpinstall.ps1 @@ -71,10 +71,10 @@ .PARAMETER UnifiedDevelopmentEnvironment Use this switch to install the package in a Unified Development Environment (UDE). - + .PARAMETER IncludeFallbackRetailServiceModels Include fallback retail service models in the topology file - + This parameter is to support backward compatibility in this scenario: Installing the first update on a local VHD where the information about the installed service models may not be available and where the retail components are installed. @@ -129,10 +129,10 @@ PS C:\> Invoke-D365SDPInstall -Path "c:\temp\" -MetaDataDir "c:\MyRepository\Metadata" -UnifiedDevelopmentEnvironment Install the modules contained in the c:\temp\ directory into the c:\MyRepository\Metadata directory. - + .EXAMPLE Invoke-D365SDPInstall -Path "c:\temp\" -Command RunAll -IncludeFallbackRetailServiceModels - + Create Topology XML from current environment. If the current environment does not have the information about the installed service models, a fallback list of known service model names will be used. This fallback list includes the retail service models. Using default runbook id 'Runbook' and run all the operations from generate, to import to execute. diff --git a/d365fo.tools/functions/invoke-d365sdpinstallude.ps1 b/d365fo.tools/functions/invoke-d365sdpinstallude.ps1 index 5d57553f..7c51cd96 100644 --- a/d365fo.tools/functions/invoke-d365sdpinstallude.ps1 +++ b/d365fo.tools/functions/invoke-d365sdpinstallude.ps1 @@ -121,4 +121,4 @@ function Invoke-D365SDPInstallUDE { Invoke-TimeSignal -End -} +} \ No newline at end of file diff --git a/d365fo.tools/internal/functions/update-topologyfile.ps1 b/d365fo.tools/internal/functions/update-topologyfile.ps1 index 9ed62d25..21fa39aa 100644 --- a/d365fo.tools/internal/functions/update-topologyfile.ps1 +++ b/d365fo.tools/internal/functions/update-topologyfile.ps1 @@ -15,10 +15,10 @@ Path to the topology file to update If not specified, the default topology file will be used - + .PARAMETER IncludeFallbackRetailServiceModels Include fallback retail service models in the topology file - + This parameter is to support backward compatibility in this scenario: Installing the first update on a local VHD where the information about the installed service models may not be available and where the retail components are installed. diff --git a/d365fo.tools/tests/functions/Invoke-D365SDPInstall.Tests.ps1 b/d365fo.tools/tests/functions/Invoke-D365SDPInstall.Tests.ps1 index 5e0e1e3b..0ad0d0ad 100644 --- a/d365fo.tools/tests/functions/Invoke-D365SDPInstall.Tests.ps1 +++ b/d365fo.tools/tests/functions/Invoke-D365SDPInstall.Tests.ps1 @@ -180,30 +180,43 @@ $parameter.ParameterSets['UDEInstall'].ValueFromPipelineByPropertyName | Should -Be $False $parameter.ParameterSets['UDEInstall'].ValueFromRemainingArguments | Should -Be $False } + It 'Should have the expected parameter IncludeFallbackRetailServiceModels' { + $parameter = (Get-Command Invoke-D365SDPInstall).Parameters['IncludeFallbackRetailServiceModels'] + $parameter.Name | Should -Be 'IncludeFallbackRetailServiceModels' + $parameter.ParameterType.ToString() | Should -Be System.Management.Automation.SwitchParameter + $parameter.IsDynamic | Should -Be $False + $parameter.ParameterSets.Keys | Should -Be '__AllParameterSets' + $parameter.ParameterSets.Keys | Should -Contain '__AllParameterSets' + $parameter.ParameterSets['__AllParameterSets'].IsMandatory | Should -Be $False + $parameter.ParameterSets['__AllParameterSets'].Position | Should -Be -2147483648 + $parameter.ParameterSets['__AllParameterSets'].ValueFromPipeline | Should -Be $False + $parameter.ParameterSets['__AllParameterSets'].ValueFromPipelineByPropertyName | Should -Be $False + $parameter.ParameterSets['__AllParameterSets'].ValueFromRemainingArguments | Should -Be $False + } } Describe "Testing parameterset QuickInstall" { <# QuickInstall -Path - QuickInstall -Path -MetaDataDir -QuickInstallAll -Step -RunbookId -LogPath -ShowOriginalProgress -OutputCommandOnly -TopologyFile -UseExistingTopologyFile + QuickInstall -Path -MetaDataDir -QuickInstallAll -Step -RunbookId -LogPath -ShowOriginalProgress -OutputCommandOnly -TopologyFile -UseExistingTopologyFile -IncludeFallbackRetailServiceModels #> } Describe "Testing parameterset DevInstall" { <# DevInstall -Path - DevInstall -Path -MetaDataDir -DevInstall -Step -RunbookId -LogPath -ShowOriginalProgress -OutputCommandOnly -TopologyFile -UseExistingTopologyFile + DevInstall -Path -MetaDataDir -DevInstall -Step -RunbookId -LogPath -ShowOriginalProgress -OutputCommandOnly -TopologyFile -UseExistingTopologyFile -IncludeFallbackRetailServiceModels #> } Describe "Testing parameterset Manual" { <# Manual -Path -Command - Manual -Path -MetaDataDir -Command -Step -RunbookId -LogPath -ShowOriginalProgress -OutputCommandOnly -TopologyFile -UseExistingTopologyFile + Manual -Path -MetaDataDir -Command -Step -RunbookId -LogPath -ShowOriginalProgress -OutputCommandOnly -TopologyFile -UseExistingTopologyFile -IncludeFallbackRetailServiceModels #> } Describe "Testing parameterset UDEInstall" { <# UDEInstall -Path - UDEInstall -Path -MetaDataDir -Step -RunbookId -LogPath -ShowOriginalProgress -OutputCommandOnly -TopologyFile -UseExistingTopologyFile -UnifiedDevelopmentEnvironment + UDEInstall -Path -MetaDataDir -Step -RunbookId -LogPath -ShowOriginalProgress -OutputCommandOnly -TopologyFile -UseExistingTopologyFile -UnifiedDevelopmentEnvironment -IncludeFallbackRetailServiceModels #> } diff --git a/docs/Invoke-D365SDPInstall.md b/docs/Invoke-D365SDPInstall.md index ce3158f4..fb27a6fc 100644 --- a/docs/Invoke-D365SDPInstall.md +++ b/docs/Invoke-D365SDPInstall.md @@ -16,28 +16,29 @@ Install a Software Deployable Package (SDP) ``` Invoke-D365SDPInstall [-Path] [[-MetaDataDir] ] [-QuickInstallAll] [[-Step] ] [[-RunbookId] ] [-LogPath ] [-ShowOriginalProgress] [-OutputCommandOnly] - [-TopologyFile ] [-UseExistingTopologyFile] [] + [-TopologyFile ] [-UseExistingTopologyFile] [-IncludeFallbackRetailServiceModels] [] ``` ### DevInstall ``` Invoke-D365SDPInstall [-Path] [[-MetaDataDir] ] [-DevInstall] [[-Step] ] [[-RunbookId] ] [-LogPath ] [-ShowOriginalProgress] [-OutputCommandOnly] - [-TopologyFile ] [-UseExistingTopologyFile] [] + [-TopologyFile ] [-UseExistingTopologyFile] [-IncludeFallbackRetailServiceModels] [] ``` ### Manual ``` Invoke-D365SDPInstall [-Path] [[-MetaDataDir] ] [-Command] [[-Step] ] [[-RunbookId] ] [-LogPath ] [-ShowOriginalProgress] [-OutputCommandOnly] - [-TopologyFile ] [-UseExistingTopologyFile] [] + [-TopologyFile ] [-UseExistingTopologyFile] [-IncludeFallbackRetailServiceModels] [] ``` ### UDEInstall ``` Invoke-D365SDPInstall [-Path] [[-MetaDataDir] ] [[-Step] ] [[-RunbookId] ] [-LogPath ] [-ShowOriginalProgress] [-OutputCommandOnly] [-TopologyFile ] - [-UseExistingTopologyFile] [-UnifiedDevelopmentEnvironment] [] + [-UseExistingTopologyFile] [-UnifiedDevelopmentEnvironment] [-IncludeFallbackRetailServiceModels] + [] ``` ## DESCRIPTION @@ -119,6 +120,16 @@ Invoke-D365SDPInstall -Path "c:\temp\" -MetaDataDir "c:\MyRepository\Metadata" - Install the modules contained in the c:\temp\ directory into the c:\MyRepository\Metadata directory. +### EXAMPLE 10 +``` +Invoke-D365SDPInstall -Path "c:\temp\" -Command RunAll -IncludeFallbackRetailServiceModels +``` + +Create Topology XML from current environment. +If the current environment does not have the information about the installed service models, a fallback list of known service model names will be used. +This fallback list includes the retail service models. +Using default runbook id 'Runbook' and run all the operations from generate, to import to execute. + ## PARAMETERS ### -Path @@ -343,6 +354,26 @@ Accept pipeline input: False Accept wildcard characters: False ``` +### -IncludeFallbackRetailServiceModels +Include fallback retail service models in the topology file + +This parameter is to support backward compatibility in this scenario: +Installing the first update on a local VHD where the information about the installed service +models may not be available and where the retail components are installed. +More information about this can be found at https://github.com/d365collaborative/d365fo.tools/issues/878 + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: False +Accept pipeline input: False +Accept wildcard characters: False +``` + ### CommonParameters This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).