Skip to content

Commit

Permalink
Bug fix for Import-PSGetRepository in Windows PS (#1460)
Browse files Browse the repository at this point in the history
  • Loading branch information
alerickson authored and anamnavi committed Nov 7, 2023
1 parent b4ec406 commit 89e78c0
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Microsoft.PowerShell.PSResourceGet.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,11 @@ function Import-PSGetRepository {
Microsoft.PowerShell.Utility\Write-Verbose ('Found {0} registered PowerShellGet repositories.' -f $PSGetRepositories.Count)

if ($PSGetRepositories.Count) {
$repos = $PSGetRepositories.Values |
$repos = @(
$PSGetRepositories.Values |
Microsoft.PowerShell.Core\Where-Object {$_.PackageManagementProvider -eq 'NuGet'-and $_.Name -ne 'PSGallery'} |
Microsoft.PowerShell.Utility\Select-Object Name, Trusted, SourceLocation
)

Microsoft.PowerShell.Utility\Write-Verbose ('Selected {0} NuGet repositories.' -f $repos.Count)

Expand Down

0 comments on commit 89e78c0

Please sign in to comment.