Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/validate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
- uses: actions/checkout@v1
- name: Install Prerequisites
run: .\build\vsts-prerequisites.ps1
shell: powershell
shell: pwsh
- name: Validate
run: .\build\vsts-validate.ps1
shell: powershell
shell: pwsh
22 changes: 14 additions & 8 deletions ModuleExplorer/functions/Show-ModuleExplorer.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -91,14 +91,20 @@ function Show-ModuleExplorer {
# Reset the main loop if modules changes (install/remove)
$moduleLookup.Clear()
$moduleChoices = @($exitChoiceString, $refreshChoiceString)

$moduleChoices += $availableModules | ForEach-Object {
$versionString = if ($_.Version) { "v$($_.Version)" } else { "Version N/A" }
$displayName = "$($_.Name) ($versionString)"
$moduleLookup[$displayName] = $_ # Populate the lookup table
$displayName

$processedDisplayNames = @{}

foreach ($module in $availableModules) {
$versionString = if ($module.Version) { "v$($module.Version)"} else { "Version N/A" }
$displayName = "$($module.Name) ($versionString)"

if (-not $processedDisplayNames.ContainsKey($displayName)) {
$moduleLookup[$displayName] = $module
$moduleChoices += $displayName
$processedDisplayNames[$displayName] = $true
}
}

$promptTitle = "[yellow bold]Select a PowerShell Module to Explore (or Exit):[/]"
Write-SpectreRule -Title "[grey] Installed Modules: $($availableModules.Count) [/]" -Alignment Center
$selectedModuleDisplay = Read-SpectreSelection -Message $promptTitle -PageSize 15 -Choices $moduleChoices -EnableSearch
Expand All @@ -122,7 +128,7 @@ function Show-ModuleExplorer {
Read-SpectrePause -Message "[grey]Press Enter to continue...[/]" -NoNewline
continue
}

Clear-Host
Show-ModuleCommandViewer -SelectedModule $selectedModuleObject

Expand Down