Skip to content

Commit 5160e70

Browse files
🩹 [Patch]: Turn down the chatter in the module loader (#74)
## Description - Turn down the verbosity of a module loader, by swapping some of the `Write-Verbose` and `Write-Warning` to `Write-Debug`. ## Type of change <!-- Use the check-boxes [x] on the options that are relevant. --> - [ ] 📖 [Docs] - [ ] 🪲 [Fix] - [x] 🩹 [Patch] - [ ] ⚠️ [Security fix] - [ ] 🚀 [Feature] - [ ] 🌟 [Breaking change] ## Checklist <!-- Use the check-boxes [x] on the options that are relevant. --> - [x] I have performed a self-review of my own code - [x] I have commented my code, particularly in hard-to-understand areas
1 parent 5f5b06c commit 5160e70

File tree

2 files changed

+14
-14
lines changed

2 files changed

+14
-14
lines changed

scripts/helpers/Build/Add-ContentFromItem.ps1

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333

3434
Add-Content -Path $RootModuleFilePath -Force -Value @"
3535
#region - From $relativeFolderPath
36-
Write-Verbose "[`$scriptName] - $relativeFolderPath - Processing folder"
36+
Write-Debug "[`$scriptName] - $relativeFolderPath - Processing folder"
3737
3838
"@
3939

@@ -52,19 +52,19 @@ Write-Verbose "[`$scriptName] - $relativeFolderPath - Processing folder"
5252

5353
Add-Content -Path $RootModuleFilePath -Force -Value @"
5454
#region - From $relativeFilePath
55-
Write-Verbose "[`$scriptName] - $relativeFilePath - Importing"
55+
Write-Debug "[`$scriptName] - $relativeFilePath - Importing"
5656
5757
"@
5858
Get-Content -Path $file.FullName | Add-Content -Path $RootModuleFilePath -Force
5959
Add-Content -Path $RootModuleFilePath -Value @"
6060
61-
Write-Verbose "[`$scriptName] - $relativeFilePath - Done"
61+
Write-Debug "[`$scriptName] - $relativeFilePath - Done"
6262
#endregion - From $relativeFilePath
6363
"@
6464
}
6565
Add-Content -Path $RootModuleFilePath -Force -Value @"
6666
67-
Write-Verbose "[`$scriptName] - $relativeFolderPath - Done"
67+
Write-Debug "[`$scriptName] - $relativeFolderPath - Done"
6868
#endregion - From $relativeFolderPath
6969
7070
"@

scripts/helpers/Build/Build-PSModuleRootModule.ps1

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ $ExportableEnums = @(
8181
$ExportableEnums | Foreach-Object { Write-Verbose "Exporting enum '$($_.FullName)'." }
8282
foreach ($Type in $ExportableEnums) {
8383
if ($Type.FullName -in $ExistingTypeAccelerators.Keys) {
84-
Write-Warning "Enum already exists [$($Type.FullName)]. Skipping."
84+
Write-Verbose "Enum already exists [$($Type.FullName)]. Skipping."
8585
} else {
8686
Write-Verbose "Importing enum '$Type'."
8787
$TypeAcceleratorsClass::Add($Type.FullName, $Type)
@@ -99,7 +99,7 @@ $ExportableClasses = @(
9999
$ExportableClasses | Foreach-Object { Write-Verbose "Exporting class '$($_.FullName)'." }
100100
foreach ($Type in $ExportableClasses) {
101101
if ($Type.FullName -in $ExistingTypeAccelerators.Keys) {
102-
Write-Warning "Class already exists [$($Type.FullName)]. Skipping."
102+
Write-Verbose "Class already exists [$($Type.FullName)]. Skipping."
103103
} else {
104104
Write-Verbose "Importing class '$Type'."
105105
$TypeAcceleratorsClass::Add($Type.FullName, $Type)
@@ -142,7 +142,7 @@ param()
142142
#region - Module post-header
143143
Add-Content -Path $rootModuleFile -Force -Value @"
144144
`$scriptName = '$ModuleName'
145-
Write-Verbose "[`$scriptName] - Importing module"
145+
Write-Debug "[`$scriptName] - Importing module"
146146
147147
"@
148148
#endregion - Module post-header
@@ -152,16 +152,16 @@ Write-Verbose "[`$scriptName] - Importing module"
152152

153153
Add-Content -Path $rootModuleFile.FullName -Force -Value @'
154154
#region - Data import
155-
Write-Verbose "[$scriptName] - [data] - Processing folder"
155+
Write-Debug "[$scriptName] - [data] - Processing folder"
156156
$dataFolder = (Join-Path $PSScriptRoot 'data')
157-
Write-Verbose "[$scriptName] - [data] - [$dataFolder]"
157+
Write-Debug "[$scriptName] - [data] - [$dataFolder]"
158158
Get-ChildItem -Path "$dataFolder" -Recurse -Force -Include '*.psd1' -ErrorAction SilentlyContinue | ForEach-Object {
159-
Write-Verbose "[$scriptName] - [data] - [$($_.BaseName)] - Importing"
159+
Write-Debug "[$scriptName] - [data] - [$($_.BaseName)] - Importing"
160160
New-Variable -Name $_.BaseName -Value (Import-PowerShellDataFile -Path $_.FullName) -Force
161-
Write-Verbose "[$scriptName] - [data] - [$($_.BaseName)] - Done"
161+
Write-Debug "[$scriptName] - [data] - [$($_.BaseName)] - Done"
162162
}
163163
164-
Write-Verbose "[$scriptName] - [data] - Done"
164+
Write-Debug "[$scriptName] - [data] - Done"
165165
#endregion - Data import
166166
167167
'@
@@ -200,13 +200,13 @@ Write-Verbose "[$scriptName] - [data] - Done"
200200

201201
Add-Content -Path $rootModuleFile -Force -Value @"
202202
#region - From $relativePath
203-
Write-Verbose "[`$scriptName] - $relativePath - Importing"
203+
Write-Debug "[`$scriptName] - $relativePath - Importing"
204204
205205
"@
206206
Get-Content -Path $file.FullName | Add-Content -Path $rootModuleFile -Force
207207

208208
Add-Content -Path $rootModuleFile -Force -Value @"
209-
Write-Verbose "[`$scriptName] - $relativePath - Done"
209+
Write-Debug "[`$scriptName] - $relativePath - Done"
210210
#endregion - From $relativePath
211211
212212
"@

0 commit comments

Comments
 (0)