File tree 3 files changed +50
-2
lines changed
3 files changed +50
-2
lines changed Original file line number Diff line number Diff line change @@ -39,6 +39,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
39
39
header equals the filename.
40
40
- Task ` Generate_Markdown_For_Public_Commands `
41
41
- Verbose output of the markdown files that was created.
42
+ - Task ` Generate_Markdown_For_DSC_Resources `
43
+ - Outputs a warning message if the old configuration key is used in the
44
+ build configuration but keeps using the old configuration key.
42
45
43
46
### Fixed
44
47
Original file line number Diff line number Diff line change @@ -89,7 +89,16 @@ Task Generate_Markdown_For_DSC_Resources {
89
89
90
90
Write-Build - Color ' Magenta' - Text ' Generating Wiki content for all DSC resources based on source and built module.'
91
91
92
- $dscResourceMarkdownMetadata = $BuildInfo .' DscResource.DocGenerator' .Generate_Markdown_For_DSC_Resources
92
+ if ($BuildInfo .' DscResource.DocGenerator' .Generate_Wiki_Content)
93
+ {
94
+ Write-Warning - Message ' Build configuration is using the old configuration key '' Generate_Wiki_Content'' . Update the build configuration to use the new configuration key '' Generate_Markdown_For_DSC_Resources'' '
95
+
96
+ $dscResourceMarkdownMetadata = $BuildInfo .' DscResource.DocGenerator' .Generate_Wiki_Content
97
+ }
98
+ else
99
+ {
100
+ $dscResourceMarkdownMetadata = $BuildInfo .' DscResource.DocGenerator' .Generate_Markdown_For_DSC_Resources
101
+ }
93
102
94
103
New-DscResourceWikiPage - SourcePath $SourcePath - BuiltModulePath $builtModuleBase - OutputPath $wikiOutputPath - Metadata $dscResourceMarkdownMetadata - Force
95
104
}
Original file line number Diff line number Diff line change @@ -41,7 +41,43 @@ Describe 'Generate_Markdown_For_DSC_Resources' {
41
41
{
42
42
$taskParameters = @ {
43
43
ProjectName = ' DscResource.DocGenerator'
44
- SourcePath = $TestDrive
44
+ SourcePath = $TestDrive
45
+ }
46
+
47
+ Invoke-Build - Task $buildTaskName - File $script :buildScript.Definition @taskParameters
48
+ } | Should -Not - Throw
49
+
50
+ Assert-MockCalled - CommandName New-DscResourceWikiPage - Exactly - Times 1 - Scope It
51
+ }
52
+
53
+ It ' Should run the build task with old configuration key without throwing' {
54
+ {
55
+ $taskParameters = @ {
56
+ ProjectName = ' DscResource.DocGenerator'
57
+ SourcePath = $TestDrive
58
+ BuildInfo = @ {
59
+ ' DscResource.DocGenerator' = @ {
60
+ Generate_Wiki_Content = @ {}
61
+ }
62
+ }
63
+ }
64
+
65
+ Invoke-Build - Task $buildTaskName - File $script :buildScript.Definition @taskParameters
66
+ } | Should -Not - Throw
67
+
68
+ Assert-MockCalled - CommandName New-DscResourceWikiPage - Exactly - Times 1 - Scope It
69
+ }
70
+
71
+ It ' Should run the build task with new configuration key without throwing' {
72
+ {
73
+ $taskParameters = @ {
74
+ ProjectName = ' DscResource.DocGenerator'
75
+ SourcePath = $TestDrive
76
+ BuildInfo = @ {
77
+ ' DscResource.DocGenerator' = @ {
78
+ Generate_Markdown_For_DSC_Resources = @ {}
79
+ }
80
+ }
45
81
}
46
82
47
83
Invoke-Build - Task $buildTaskName - File $script :buildScript.Definition @taskParameters
You can’t perform that action at this time.
0 commit comments