Skip to content

Commit 01bcf16

Browse files
🩹 [Patch]: Make Alias Export more verbose (#62)
## Description - Make Alias Export more verbose ## 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 78f2396 commit 01bcf16

File tree

1 file changed

+17
-4
lines changed

1 file changed

+17
-4
lines changed

scripts/helpers/Build/Update-PSModuleManifestAliasesToExport.ps1

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ function Update-PSModuleManifestAliasesToExport {
77
'PSUseShouldProcessForStateChangingFunctions', '', Scope = 'Function',
88
Justification = 'Updates a file that is being built.'
99
)]
10+
[Diagnostics.CodeAnalysis.SuppressMessageAttribute(
11+
'PSReviewUnusedParameter', '', Scope = 'Function',
12+
Justification = 'LogGroup - Scoping affects the variables line of sight.'
13+
)]
1014
[CmdletBinding()]
1115
param(
1216
# Name of the module.
@@ -17,8 +21,17 @@ function Update-PSModuleManifestAliasesToExport {
1721
[Parameter(Mandatory)]
1822
[System.IO.DirectoryInfo] $ModuleOutputFolder
1923
)
20-
21-
$aliases = Get-Command -Module $ModuleName -CommandType Alias
22-
$outputManifestPath = Join-Path -Path $ModuleOutputFolder -ChildPath "$ModuleName.psd1"
23-
Set-ModuleManifest -Path $outputManifestPath -AliasesToExport $aliases.Name -Verbose:$false
24+
LogGroup "Updating aliases to export in module manifest" {
25+
Write-Verbose "Module name: [$ModuleName]"
26+
Write-Verbose "Module output folder: [$ModuleOutputFolder]"
27+
$aliases = Get-Command -Module $ModuleName -CommandType Alias
28+
Write-Verbose "Found aliases: [$($aliases.Count)]"
29+
foreach ($alias in $aliases) {
30+
Write-Verbose "Alias: [$($alias.Name)]"
31+
}
32+
$outputManifestPath = Join-Path -Path $ModuleOutputFolder -ChildPath "$ModuleName.psd1"
33+
Write-Verbose "Output manifest path: [$outputManifestPath]"
34+
Write-Verbose "Setting module manifest with AliasesToExport"
35+
Set-ModuleManifest -Path $outputManifestPath -AliasesToExport $aliases.Name
36+
}
2437
}

0 commit comments

Comments
 (0)