@@ -94,12 +94,12 @@ task DebugBuild -if ($Configuration -eq "debug") {
9494 $privateFunctions = Get-ChildItem - Path " .\Source\Private\*.ps1"
9595 try {
9696 Write-Verbose - Message " Appending Public functions to the psm file"
97- $functionsToExport = New-Object - TypeName System.Collections.ArrayList
98- foreach ($function in $publicFunctions.Name ){
99- write-Verbose - Message " Exporting function: $ ( ($function .split (' .' )[0 ]).ToString()) "
100- $functionsToExport .Add (($function .split (' .' )[0 ]).ToString())
97+ $FunctionsToExport = New-Object - TypeName System.Collections.ArrayList
98+ foreach ($Function in $publicFunctions.Name ){
99+ write-Verbose - Message " Exporting function: $ ( ($Function .split (' .' )[0 ]).ToString()) "
100+ $FunctionsToExport .Add (($Function .split (' .' )[0 ]).ToString())
101101 }
102- Update-ModuleManifest - Path " .\Output\temp\$ ( $ModuleName ) \$ ( $ModuleVersion ) \$ ( $ModuleName ) .psd1" - FunctionsToExport $functionsToExport
102+ Update-ModuleManifest - Path " .\Output\temp\$ ( $ModuleName ) \$ ( $ModuleVersion ) \$ ( $ModuleName ) .psd1" - FunctionsToExport $FunctionsToExport
103103 }
104104 catch {
105105 throw " Failed updating Module manifest with public functions"
@@ -108,51 +108,51 @@ task DebugBuild -if ($Configuration -eq "debug") {
108108 Write-Verbose - Message " Building the .psm1 file"
109109 Write-Verbose - Message " Appending Public Functions"
110110 Add-Content - Path $ModuleFile - Value " ### --- PUBLIC FUNCTIONS --- ###"
111- foreach ($function in $publicFunctions.Name ){
111+ foreach ($Function in $publicFunctions.Name ){
112112 try {
113- Write-Verbose - Message " Updating the .psm1 file with function: $ ( $function ) "
114- $content = Get-Content - Path " .\Source\Public\$ ( $function ) "
115- Add-Content - Path $ModuleFile - Value " #Region - $function "
113+ Write-Verbose - Message " Updating the .psm1 file with function: $ ( $Function ) "
114+ $content = Get-Content - Path " .\Source\Public\$ ( $Function ) "
115+ Add-Content - Path $ModuleFile - Value " #Region - $Function "
116116 Add-Content - Path $ModuleFile - Value $content
117117 if ($ExportAlias.IsPresent ){
118- $AliasSwitch = $false
119- $Sel = Select-String - Path " .\Source\Public\$ ( $function ) " - Pattern " CmdletBinding" - Context 0 , 1
120- $mylist = $Sel.ToString ().Split([Environment ]::NewLine)
121- foreach ($s in $mylist ){
118+ $AliasSwitch = $False
119+ $Sel = Select-String - Path " .\Source\Public\$ ( $Function ) " - Pattern " CmdletBinding" - Context 0 , 1
120+ $Mylist = $Sel.ToString ().Split([Environment ]::NewLine)
121+ foreach ($s in $Mylist ){
122122 if ($s -match " Alias" ){
123123 $alias = (($s.split (" :" )[2 ]).split(" (" )[1 ]).split(" )" )[0 ]
124- Write-Verbose - Message " Exporting Alias: $ ( $alias ) to Function: $ ( $function ) "
125- Add-Content - Path $ModuleFile - Value " Export-ModuleMember -Function $ ( ($function .split (' .' )[0 ]).ToString()) -Alias $alias "
124+ Write-Verbose - Message " Exporting Alias: $ ( $alias ) to Function: $ ( $Function ) "
125+ Add-Content - Path $ModuleFile - Value " Export-ModuleMember -Function $ ( ($Function .split (' .' )[0 ]).ToString()) -Alias $alias "
126126 $AliasSwitch = $true
127127 }
128128 }
129- if ($AliasSwitch -eq $false ){
130- Write-Verbose - Message " No alias was found in function: $ ( $function ) )"
131- Add-Content - Path $ModuleFile - Value " Export-ModuleMember -Function $ ( ($function .split (' .' )[0 ]).ToString()) "
129+ if ($AliasSwitch -eq $False ){
130+ Write-Verbose - Message " No alias was found in function: $ ( $Function ) )"
131+ Add-Content - Path $ModuleFile - Value " Export-ModuleMember -Function $ ( ($Function .split (' .' )[0 ]).ToString()) "
132132 }
133133 }
134134 else {
135- Add-Content - Path $ModuleFile - Value " Export-ModuleMember -Function $ ( ($function .split (' .' )[0 ]).ToString()) "
135+ Add-Content - Path $ModuleFile - Value " Export-ModuleMember -Function $ ( ($Function .split (' .' )[0 ]).ToString()) "
136136 }
137- Add-Content - Path $ModuleFile - Value " #EndRegion - $function "
137+ Add-Content - Path $ModuleFile - Value " #EndRegion - $Function "
138138 }
139139 catch {
140- throw " Failed adding content to .psm1 for function: $ ( $function ) "
140+ throw " Failed adding content to .psm1 for function: $ ( $Function ) "
141141 }
142142 }
143143
144144 Write-Verbose - Message " Appending Private functions"
145145 Add-Content - Path $ModuleFile - Value " ### --- PRIVATE FUNCTIONS --- ###"
146- foreach ($function in $privateFunctions.Name ){
146+ foreach ($Function in $privateFunctions.Name ){
147147 try {
148- Write-Verbose - Message " Updating the .psm1 file with function: $ ( $function ) "
149- $content = Get-Content - Path " .\Source\Private\$ ( $function ) "
150- Add-Content - Path $ModuleFile - Value " #Region - $function "
148+ Write-Verbose - Message " Updating the .psm1 file with function: $ ( $Function ) "
149+ $content = Get-Content - Path " .\Source\Private\$ ( $Function ) "
150+ Add-Content - Path $ModuleFile - Value " #Region - $Function "
151151 Add-Content - Path $ModuleFile - Value $content
152- Add-Content - Path $ModuleFile - Value " #EndRegion - $function "
152+ Add-Content - Path $ModuleFile - Value " #EndRegion - $Function "
153153 }
154154 catch {
155- throw " Failed adding content to .psm1 for function: $ ( $function ) "
155+ throw " Failed adding content to .psm1 for function: $ ( $Function ) "
156156 }
157157 }
158158}
@@ -193,7 +193,7 @@ task Build -if($Configuration -eq "Release"){
193193 Remove-Item - Path " .\Output\$ ( $ModuleName ) " - Recurse - Force
194194 }
195195 try {
196-
196+
197197 New-Item - Path " .\Output\$ ( $ModuleName ) \$ ( $ModuleVersion ) " - ItemType Directory
198198 }
199199 catch {
@@ -212,12 +212,12 @@ task Build -if($Configuration -eq "Release"){
212212 Write-Verbose - Message " Updating Module Manifest with Public Functions"
213213 try {
214214 Write-Verbose - Message " Appending Public functions to the psm file"
215- $functionsToExport = New-Object - TypeName System.Collections.ArrayList
216- foreach ($function in $publicFunctions.Name ){
217- write-Verbose - Message " Exporting function: $ ( ($function .split (' .' )[0 ]).ToString()) "
218- $functionsToExport .Add (($function .split (' .' )[0 ]).ToString())
215+ $FunctionsToExport = New-Object - TypeName System.Collections.ArrayList
216+ foreach ($Function in $publicFunctions.Name ){
217+ write-Verbose - Message " Exporting function: $ ( ($Function .split (' .' )[0 ]).ToString()) "
218+ $FunctionsToExport .Add (($Function .split (' .' )[0 ]).ToString())
219219 }
220- Update-ModuleManifest - Path " .\Output\$ ( $ModuleName ) \$ ( $ModuleVersion ) \$ ( $ModuleName ) .psd1" - FunctionsToExport $functionsToExport
220+ Update-ModuleManifest - Path " .\Output\$ ( $ModuleName ) \$ ( $ModuleVersion ) \$ ( $ModuleName ) .psd1" - FunctionsToExport $FunctionsToExport
221221 }
222222 catch {
223223 throw " Failed updating Module manifest with public functions"
@@ -226,51 +226,51 @@ task Build -if($Configuration -eq "Release"){
226226 Write-Verbose - Message " Building the .psm1 file"
227227 Write-Verbose - Message " Appending Public Functions"
228228 Add-Content - Path $ModuleFile - Value " ### --- PUBLIC FUNCTIONS --- ###"
229- foreach ($function in $publicFunctions.Name ){
229+ foreach ($Function in $publicFunctions.Name ){
230230 try {
231- Write-Verbose - Message " Updating the .psm1 file with function: $ ( $function ) "
232- $content = Get-Content - Path " .\Source\Public\$ ( $function ) "
233- Add-Content - Path $ModuleFile - Value " #Region - $function "
231+ Write-Verbose - Message " Updating the .psm1 file with function: $ ( $Function ) "
232+ $content = Get-Content - Path " .\Source\Public\$ ( $Function ) "
233+ Add-Content - Path $ModuleFile - Value " #Region - $Function "
234234 Add-Content - Path $ModuleFile - Value $content
235235 if ($ExportAlias.IsPresent ){
236- $AliasSwitch = $false
237- $Sel = Select-String - Path " .\Source\Public\$ ( $function ) " - Pattern " CmdletBinding" - Context 0 , 1
238- $mylist = $Sel.ToString ().Split([Environment ]::NewLine)
239- foreach ($s in $mylist ){
236+ $AliasSwitch = $False
237+ $Sel = Select-String - Path " .\Source\Public\$ ( $Function ) " - Pattern " CmdletBinding" - Context 0 , 1
238+ $Mylist = $Sel.ToString ().Split([Environment ]::NewLine)
239+ foreach ($s in $Mylist ){
240240 if ($s -match " Alias" ){
241241 $alias = (($s.split (" :" )[2 ]).split(" (" )[1 ]).split(" )" )[0 ]
242- Write-Verbose - Message " Exporting Alias: $ ( $alias ) to Function: $ ( $function ) "
243- Add-Content - Path $ModuleFile - Value " Export-ModuleMember -Function $ ( ($function .split (' .' )[0 ]).ToString()) -Alias $alias "
242+ Write-Verbose - Message " Exporting Alias: $ ( $alias ) to Function: $ ( $Function ) "
243+ Add-Content - Path $ModuleFile - Value " Export-ModuleMember -Function $ ( ($Function .split (' .' )[0 ]).ToString()) -Alias $alias "
244244 $AliasSwitch = $true
245245 }
246246 }
247- if ($AliasSwitch -eq $false ){
248- Write-Verbose - Message " No alias was found in function: $ ( $function ) )"
249- Add-Content - Path $ModuleFile - Value " Export-ModuleMember -Function $ ( ($function .split (' .' )[0 ]).ToString()) "
247+ if ($AliasSwitch -eq $False ){
248+ Write-Verbose - Message " No alias was found in function: $ ( $Function ) )"
249+ Add-Content - Path $ModuleFile - Value " Export-ModuleMember -Function $ ( ($Function .split (' .' )[0 ]).ToString()) "
250250 }
251251 }
252252 else {
253- Add-Content - Path $ModuleFile - Value " Export-ModuleMember -Function $ ( ($function .split (' .' )[0 ]).ToString()) "
253+ Add-Content - Path $ModuleFile - Value " Export-ModuleMember -Function $ ( ($Function .split (' .' )[0 ]).ToString()) "
254254 }
255- Add-Content - Path $ModuleFile - Value " #EndRegion - $function "
255+ Add-Content - Path $ModuleFile - Value " #EndRegion - $Function "
256256 }
257257 catch {
258- throw " Failed adding content to .psm1 for function: $ ( $function ) "
258+ throw " Failed adding content to .psm1 for function: $ ( $Function ) "
259259 }
260260 }
261261
262262 Write-Verbose - Message " Appending Private functions"
263263 Add-Content - Path $ModuleFile - Value " ### --- PRIVATE FUNCTIONS --- ###"
264- foreach ($function in $privateFunctions.Name ){
264+ foreach ($Function in $privateFunctions.Name ){
265265 try {
266- Write-Verbose - Message " Updating the .psm1 file with function: $ ( $function ) "
267- $content = Get-Content - Path " .\Source\Private\$ ( $function ) "
268- Add-Content - Path $ModuleFile - Value " #Region - $function "
266+ Write-Verbose - Message " Updating the .psm1 file with function: $ ( $Function ) "
267+ $content = Get-Content - Path " .\Source\Private\$ ( $Function ) "
268+ Add-Content - Path $ModuleFile - Value " #Region - $Function "
269269 Add-Content - Path $ModuleFile - Value $content
270- Add-Content - Path $ModuleFile - Value " #EndRegion - $function "
270+ Add-Content - Path $ModuleFile - Value " #EndRegion - $Function "
271271 }
272272 catch {
273- throw " Failed adding content to .psm1 for function: $ ( $function ) "
273+ throw " Failed adding content to .psm1 for function: $ ( $Function ) "
274274 }
275275 }
276276
0 commit comments