@@ -36,8 +36,45 @@ $MODULE_NAME = (Get-ChildItem -Path $MODULE_ROOT_PATH -Filter *.psd1 | Select-Ob
3636
3737# Helper for module variables
3838
39-
40- $VALID_FOLDER_NAMES = @ (' Include' , ' Private' , ' Public' , ' Root' , ' TestInclude' , ' TestPrivate' , ' TestPublic' , ' TestRoot' , ' Tools' , ' DevContainer' , ' WorkFlows' , ' GitHub' , ' Helper' , ' Config' , ' TestHelper' , ' TestConfig' )
39+ # Folders names that IncludeHelper may add content to
40+ $VALID_INCLUDE_FOLDER_NAMES = @ (
41+ ' Root' ,
42+ ' Include' ,
43+ ' DevContainer' ,
44+ ' WorkFlows' ,
45+ ' GitHub' ,
46+ # 'Config',
47+ ' Helper' ,
48+ # 'Private',
49+ # 'Public',
50+ ' Tools' ,
51+
52+ ' TestRoot' ,
53+ # 'TestConfig'
54+ ' TestInclude' ,
55+ ' TestHelper' ,
56+ # 'TestPrivate',
57+ # 'TestPublic',
58+
59+ " TestHelperRoot" ,
60+ " TestHelperPrivate" ,
61+ " TestHelperPublic"
62+
63+ " VsCode"
64+ )
65+
66+ # Folders names that IncludeHelper should not add content to.
67+ # In this folders is the module code itself
68+ $VALID_MODULE_FOLDER_NAMES = @ (
69+ ' Config' ,
70+ ' Private' ,
71+ ' Public' ,
72+ ' TestConfig'
73+ ' TestPrivate' ,
74+ ' TestPublic'
75+ )
76+
77+ $VALID_FOLDER_NAMES = $VALID_INCLUDE_FOLDER_NAMES + $VALID_MODULE_FOLDER_NAMES
4178
4279class ValidFolderNames : System.Management.Automation.IValidateSetValuesGenerator {
4380 [String []] GetValidValues() {
@@ -113,59 +150,41 @@ function Get-ModuleFolder{
113150
114151 # TestRootPath
115152 $testRootPath = $ModuleRootPath | Join-Path - ChildPath " Test"
153+ $testHelperRootPath = $ModuleRootPath | Join-Path - ChildPath " tools/Test_Helper"
116154
117155 switch ($FolderName ){
118- ' Public' {
119- $moduleFolder = $ModuleRootPath | Join-Path - ChildPath " public"
120- }
121- ' Private' {
122- $moduleFolder = $ModuleRootPath | Join-Path - ChildPath " private"
123- }
124- ' Include' {
125- $moduleFolder = $ModuleRootPath | Join-Path - ChildPath " include"
126- }
127- ' TestInclude' {
128- $moduleFolder = $testRootPath | Join-Path - ChildPath " include"
129- }
130- ' TestPrivate' {
131- $moduleFolder = $testRootPath | Join-Path - ChildPath " private"
132- }
133- ' TestPublic' {
134- $moduleFolder = $testRootPath | Join-Path - ChildPath " public"
135- }
136- ' Root' {
137- $moduleFolder = $ModuleRootPath
138- }
139- ' TestRoot' {
140- $moduleFolder = $testRootPath
141- }
142- ' Tools' {
143- $moduleFolder = $ModuleRootPath | Join-Path - ChildPath " tools"
144- }
145- ' DevContainer' {
146- $moduleFolder = $ModuleRootPath | Join-Path - ChildPath " .devcontainer"
147- }
148- ' WorkFlows' {
149- $moduleFolder = $ModuleRootPath | Join-Path - ChildPath " .github/workflows"
150- }
151- ' GitHub' {
152- $moduleFolder = $ModuleRootPath | Join-Path - ChildPath " .github"
153- }
154- ' Helper' {
155- $moduleFolder = $ModuleRootPath | Join-Path - ChildPath " helper"
156- }
157- ' Config' {
158- $moduleFolder = $ModuleRootPath | Join-Path - ChildPath " config"
159- }
160- ' TestHelper' {
161- $moduleFolder = $testRootPath | Join-Path - ChildPath " helper"
162- }
163- ' TestConfig' {
164- $moduleFolder = $testRootPath | Join-Path - ChildPath " config"
165- }
156+
157+ # VALID_INCLUDE_FOLDER_NAMES
158+ ' Root' { $moduleFolder = $ModuleRootPath }
159+ ' Include' { $moduleFolder = $ModuleRootPath | Join-Path - ChildPath " include" }
160+ ' DevContainer' { $moduleFolder = $ModuleRootPath | Join-Path - ChildPath " .devcontainer" }
161+ ' WorkFlows' { $moduleFolder = $ModuleRootPath | Join-Path - ChildPath " .github/workflows" }
162+ ' GitHub' { $moduleFolder = $ModuleRootPath | Join-Path - ChildPath " .github" }
163+ ' Helper' { $moduleFolder = $ModuleRootPath | Join-Path - ChildPath " helper" }
164+ ' Tools' { $moduleFolder = $ModuleRootPath | Join-Path - ChildPath " tools" }
165+
166+ ' TestRoot' { $moduleFolder = $testRootPath }
167+ ' TestInclude' { $moduleFolder = $testRootPath | Join-Path - ChildPath " include" }
168+ ' TestHelper' { $moduleFolder = $testRootPath | Join-Path - ChildPath " helper" }
169+
170+ ' TestHelperRoot' { $moduleFolder = $testHelperRootPath }
171+ ' TestHelperPrivate' { $moduleFolder = $testHelperRootPath | Join-Path - ChildPath " private" }
172+ ' TestHelperPublic' { $moduleFolder = $testHelperRootPath | Join-Path - ChildPath " public" }
173+
174+ " VsCode" { $moduleFolder = $ModuleRootPath | Join-Path - ChildPath " .vscode" }
175+
176+ # VALID_MODULE_FOLDER_NAMES
177+ ' Config' { $moduleFolder = $ModuleRootPath | Join-Path - ChildPath " config" }
178+ ' Private' { $moduleFolder = $ModuleRootPath | Join-Path - ChildPath " private" }
179+ ' Public' { $moduleFolder = $ModuleRootPath | Join-Path - ChildPath " public" }
180+ ' TestConfig' { $moduleFolder = $testRootPath | Join-Path - ChildPath " config" }
181+ ' TestPrivate' { $moduleFolder = $testRootPath | Join-Path - ChildPath " private" }
182+ ' TestPublic' { $moduleFolder = $testRootPath | Join-Path - ChildPath " public" }
183+
184+
166185 default {
167186 throw " Folder [$FolderName ] is unknown"
168187 }
169188 }
170189 return $moduleFolder
171- } Export-ModuleMember - Function Get-ModuleFolder
190+ } Export-ModuleMember - Function Get-ModuleFolder
0 commit comments