Skip to content

Commit 96a9050

Browse files
committed
Fix: Add missing Force parameter
And updated unit tests
1 parent 0f7181b commit 96a9050

File tree

5 files changed

+73
-11
lines changed

5 files changed

+73
-11
lines changed

d365fo.tools/functions/invoke-d365sdpinstall.ps1

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,9 @@ function Invoke-D365SDPInstall {
188188
[Parameter(ParameterSetName = 'UDEInstall')]
189189
[switch] $UnifiedDevelopmentEnvironment,
190190

191-
[switch] $IncludeFallbackRetailServiceModels
191+
[switch] $IncludeFallbackRetailServiceModels,
192+
193+
[switch] $Force
192194
)
193195

194196
if ($UnifiedDevelopmentEnvironment) {

d365fo.tools/tests/functions/Invoke-D365SDPInstall.Tests.ps1

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -193,30 +193,43 @@
193193
$parameter.ParameterSets['__AllParameterSets'].ValueFromPipelineByPropertyName | Should -Be $False
194194
$parameter.ParameterSets['__AllParameterSets'].ValueFromRemainingArguments | Should -Be $False
195195
}
196+
It 'Should have the expected parameter Force' {
197+
$parameter = (Get-Command Invoke-D365SDPInstall).Parameters['Force']
198+
$parameter.Name | Should -Be 'Force'
199+
$parameter.ParameterType.ToString() | Should -Be System.Management.Automation.SwitchParameter
200+
$parameter.IsDynamic | Should -Be $False
201+
$parameter.ParameterSets.Keys | Should -Be '__AllParameterSets'
202+
$parameter.ParameterSets.Keys | Should -Contain '__AllParameterSets'
203+
$parameter.ParameterSets['__AllParameterSets'].IsMandatory | Should -Be $False
204+
$parameter.ParameterSets['__AllParameterSets'].Position | Should -Be -2147483648
205+
$parameter.ParameterSets['__AllParameterSets'].ValueFromPipeline | Should -Be $False
206+
$parameter.ParameterSets['__AllParameterSets'].ValueFromPipelineByPropertyName | Should -Be $False
207+
$parameter.ParameterSets['__AllParameterSets'].ValueFromRemainingArguments | Should -Be $False
208+
}
196209
}
197210

198211
Describe "Testing parameterset QuickInstall" {
199212
<#
200213
QuickInstall -Path
201-
QuickInstall -Path -MetaDataDir -QuickInstallAll -Step -RunbookId -LogPath -ShowOriginalProgress -OutputCommandOnly -TopologyFile -UseExistingTopologyFile -IncludeFallbackRetailServiceModels
214+
QuickInstall -Path -MetaDataDir -QuickInstallAll -Step -RunbookId -LogPath -ShowOriginalProgress -OutputCommandOnly -TopologyFile -UseExistingTopologyFile -IncludeFallbackRetailServiceModels -Force
202215
#>
203216
}
204217
Describe "Testing parameterset DevInstall" {
205218
<#
206219
DevInstall -Path
207-
DevInstall -Path -MetaDataDir -DevInstall -Step -RunbookId -LogPath -ShowOriginalProgress -OutputCommandOnly -TopologyFile -UseExistingTopologyFile -IncludeFallbackRetailServiceModels
220+
DevInstall -Path -MetaDataDir -DevInstall -Step -RunbookId -LogPath -ShowOriginalProgress -OutputCommandOnly -TopologyFile -UseExistingTopologyFile -IncludeFallbackRetailServiceModels -Force
208221
#>
209222
}
210223
Describe "Testing parameterset Manual" {
211224
<#
212225
Manual -Path -Command
213-
Manual -Path -MetaDataDir -Command -Step -RunbookId -LogPath -ShowOriginalProgress -OutputCommandOnly -TopologyFile -UseExistingTopologyFile -IncludeFallbackRetailServiceModels
226+
Manual -Path -MetaDataDir -Command -Step -RunbookId -LogPath -ShowOriginalProgress -OutputCommandOnly -TopologyFile -UseExistingTopologyFile -IncludeFallbackRetailServiceModels -Force
214227
#>
215228
}
216229
Describe "Testing parameterset UDEInstall" {
217230
<#
218231
UDEInstall -Path
219-
UDEInstall -Path -MetaDataDir -Step -RunbookId -LogPath -ShowOriginalProgress -OutputCommandOnly -TopologyFile -UseExistingTopologyFile -UnifiedDevelopmentEnvironment -IncludeFallbackRetailServiceModels
232+
UDEInstall -Path -MetaDataDir -Step -RunbookId -LogPath -ShowOriginalProgress -OutputCommandOnly -TopologyFile -UseExistingTopologyFile -UnifiedDevelopmentEnvironment -IncludeFallbackRetailServiceModels -Force
220233
#>
221234
}
222235

d365fo.tools/tests/functions/Invoke-D365SDPInstallUDE.Tests.ps1

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,25 @@
5050
$parameter.ParameterSets['__AllParameterSets'].ValueFromPipelineByPropertyName | Should -Be $False
5151
$parameter.ParameterSets['__AllParameterSets'].ValueFromRemainingArguments | Should -Be $False
5252
}
53+
It 'Should have the expected parameter Force' {
54+
$parameter = (Get-Command Invoke-D365SDPInstallUDE).Parameters['Force']
55+
$parameter.Name | Should -Be 'Force'
56+
$parameter.ParameterType.ToString() | Should -Be System.Management.Automation.SwitchParameter
57+
$parameter.IsDynamic | Should -Be $False
58+
$parameter.ParameterSets.Keys | Should -Be '__AllParameterSets'
59+
$parameter.ParameterSets.Keys | Should -Contain '__AllParameterSets'
60+
$parameter.ParameterSets['__AllParameterSets'].IsMandatory | Should -Be $False
61+
$parameter.ParameterSets['__AllParameterSets'].Position | Should -Be -2147483648
62+
$parameter.ParameterSets['__AllParameterSets'].ValueFromPipeline | Should -Be $False
63+
$parameter.ParameterSets['__AllParameterSets'].ValueFromPipelineByPropertyName | Should -Be $False
64+
$parameter.ParameterSets['__AllParameterSets'].ValueFromRemainingArguments | Should -Be $False
65+
}
5366
}
5467

5568
Describe "Testing parameterset __AllParameterSets" {
5669
<#
5770
__AllParameterSets -Path -MetaDataDir
58-
__AllParameterSets -Path -MetaDataDir -LogPath
71+
__AllParameterSets -Path -MetaDataDir -LogPath -Force
5972
#>
6073
}
6174

docs/Invoke-D365SDPInstall.md

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,28 +16,31 @@ Install a Software Deployable Package (SDP)
1616
```
1717
Invoke-D365SDPInstall [-Path] <String> [[-MetaDataDir] <String>] [-QuickInstallAll] [[-Step] <Int32>]
1818
[[-RunbookId] <String>] [-LogPath <String>] [-ShowOriginalProgress] [-OutputCommandOnly]
19-
[-TopologyFile <String>] [-UseExistingTopologyFile] [-IncludeFallbackRetailServiceModels] [<CommonParameters>]
19+
[-TopologyFile <String>] [-UseExistingTopologyFile] [-IncludeFallbackRetailServiceModels] [-Force]
20+
[<CommonParameters>]
2021
```
2122

2223
### DevInstall
2324
```
2425
Invoke-D365SDPInstall [-Path] <String> [[-MetaDataDir] <String>] [-DevInstall] [[-Step] <Int32>]
2526
[[-RunbookId] <String>] [-LogPath <String>] [-ShowOriginalProgress] [-OutputCommandOnly]
26-
[-TopologyFile <String>] [-UseExistingTopologyFile] [-IncludeFallbackRetailServiceModels] [<CommonParameters>]
27+
[-TopologyFile <String>] [-UseExistingTopologyFile] [-IncludeFallbackRetailServiceModels] [-Force]
28+
[<CommonParameters>]
2729
```
2830

2931
### Manual
3032
```
3133
Invoke-D365SDPInstall [-Path] <String> [[-MetaDataDir] <String>] [-Command] <String> [[-Step] <Int32>]
3234
[[-RunbookId] <String>] [-LogPath <String>] [-ShowOriginalProgress] [-OutputCommandOnly]
33-
[-TopologyFile <String>] [-UseExistingTopologyFile] [-IncludeFallbackRetailServiceModels] [<CommonParameters>]
35+
[-TopologyFile <String>] [-UseExistingTopologyFile] [-IncludeFallbackRetailServiceModels] [-Force]
36+
[<CommonParameters>]
3437
```
3538

3639
### UDEInstall
3740
```
3841
Invoke-D365SDPInstall [-Path] <String> [[-MetaDataDir] <String>] [[-Step] <Int32>] [[-RunbookId] <String>]
3942
[-LogPath <String>] [-ShowOriginalProgress] [-OutputCommandOnly] [-TopologyFile <String>]
40-
[-UseExistingTopologyFile] [-UnifiedDevelopmentEnvironment] [-IncludeFallbackRetailServiceModels]
43+
[-UseExistingTopologyFile] [-UnifiedDevelopmentEnvironment] [-IncludeFallbackRetailServiceModels] [-Force]
4144
[<CommonParameters>]
4245
```
4346

@@ -374,6 +377,21 @@ Accept pipeline input: False
374377
Accept wildcard characters: False
375378
```
376379
380+
### -Force
381+
{{ Fill Force Description }}
382+
383+
```yaml
384+
Type: SwitchParameter
385+
Parameter Sets: (All)
386+
Aliases:
387+
388+
Required: False
389+
Position: Named
390+
Default value: False
391+
Accept pipeline input: False
392+
Accept wildcard characters: False
393+
```
394+
377395
### CommonParameters
378396
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).
379397

docs/Invoke-D365SDPInstallUDE.md

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ Install a Software Deployable Package (SDP) in a unified development environment
1313
## SYNTAX
1414

1515
```
16-
Invoke-D365SDPInstallUDE [-Path] <String> [-MetaDataDir] <String> [-LogPath <String>] [<CommonParameters>]
16+
Invoke-D365SDPInstallUDE [-Path] <String> [-MetaDataDir] <String> [-LogPath <String>] [-Force]
17+
[<CommonParameters>]
1718
```
1819

1920
## DESCRIPTION
@@ -80,6 +81,21 @@ Accept pipeline input: False
8081
Accept wildcard characters: False
8182
```
8283
84+
### -Force
85+
{{ Fill Force Description }}
86+
87+
```yaml
88+
Type: SwitchParameter
89+
Parameter Sets: (All)
90+
Aliases:
91+
92+
Required: False
93+
Position: Named
94+
Default value: False
95+
Accept pipeline input: False
96+
Accept wildcard characters: False
97+
```
98+
8399
### CommonParameters
84100
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).
85101

0 commit comments

Comments
 (0)