Skip to content

Commit 822c481

Browse files
🩹 [Refactor]: Streamline output handling in Build-PSModuleRootModule.ps1 and Import-PSModule.ps1 for improved readability
1 parent 7c0aa18 commit 822c481

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

‎scripts/helpers/Build/Build-PSModuleRootModule.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ Write-Debug "[`$scriptName] - $relativePath - Done"
224224

225225
$exportsString = $exports | Format-Hashtable
226226

227-
Write-Host ($exportsString | Out-String)
227+
$exportsString | Out-String
228228

229229
$params = @{
230230
Path = $rootModuleFile

‎scripts/helpers/Build/Import-PSModule.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,10 @@
3636

3737
Write-Host ' - List loaded modules'
3838
$availableModules = Get-Module -ListAvailable -Refresh -Verbose:$false
39-
$availableModules | Select-Object Name, Version, Path | Sort-Object Name | Format-Table -AutoSize
39+
$availableModules | Select-Object Name, Version, Path | Sort-Object Name | Format-Table -AutoSize | Out-String
4040
Write-Host ' - List commands'
4141
$commands = Get-Command -Module $moduleName -ListImported
42-
Write-Host (Get-Command -Module $moduleName -ListImported | Format-Table -AutoSize | Out-String)
42+
Get-Command -Module $moduleName -ListImported | Format-Table -AutoSize | Out-String
4343

4444
if ($moduleName -notin $commands.Source) {
4545
throw 'Module not found'

0 commit comments

Comments
 (0)