Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

separate out retail components from fallback service models #132

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions d365fo.tools/bin/d365fo.tools-index.json
Original file line number Diff line number Diff line change
Expand Up @@ -9101,15 +9101,23 @@
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": "",
"Author": "Tommy Skaue (@skaue)",
"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",
Expand Down
23 changes: 20 additions & 3 deletions d365fo.tools/functions/invoke-d365sdpinstall.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,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

Expand Down Expand Up @@ -122,6 +130,13 @@

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)
Author: Mötz Jensen (@Splaxi)
Expand Down Expand Up @@ -171,7 +186,9 @@ function Invoke-D365SDPInstall {
[switch] $UseExistingTopologyFile,

[Parameter(ParameterSetName = 'UDEInstall')]
[switch] $UnifiedDevelopmentEnvironment
[switch] $UnifiedDevelopmentEnvironment,

[switch] $IncludeFallbackRetailServiceModels
)

if ($UnifiedDevelopmentEnvironment) {
Expand Down Expand Up @@ -260,7 +277,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
Expand Down Expand Up @@ -310,7 +327,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."
}
Expand Down
2 changes: 1 addition & 1 deletion d365fo.tools/functions/invoke-d365sdpinstallude.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -121,4 +121,4 @@ function Invoke-D365SDPInstallUDE {

Invoke-TimeSignal -End

}
}
20 changes: 18 additions & 2 deletions d365fo.tools/internal/functions/update-topologyfile.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,14 @@

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"

Expand All @@ -36,7 +44,9 @@ function Update-TopologyFile {
[Parameter(Mandatory = $true)]
[string]$Path,

[string]$TopologyFile
[string]$TopologyFile,

[switch]$IncludeFallbackRetailServiceModels
)

if (-not $TopologyFile) {
Expand All @@ -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 = $_
Expand Down
9 changes: 7 additions & 2 deletions d365fo.tools/internal/scripts/variables.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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",
Expand Down
21 changes: 17 additions & 4 deletions d365fo.tools/tests/functions/Invoke-D365SDPInstall.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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
#>
}

Expand Down
Loading