Skip to content
This repository was archived by the owner on Jun 13, 2024. It is now read-only.

Commit 26aa69a

Browse files
committed
Fix CommandAlreadyAvailable error for PackageManagement module.
This is happening as Get-Command returns the local commands from PSModule.psm1 for the Find-Package, Install-Package and Uninstall-Package provider functions. Added check to ignore the commands from PSModule.psm1. Resolves #329
1 parent b47b406 commit 26aa69a

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

PowerShellGet/private/functions/Validate-ModuleCommandAlreadyAvailable.ps1

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ function Validate-ModuleCommandAlreadyAvailable
5656
-WarningAction SilentlyContinue |
5757
Microsoft.PowerShell.Core\Where-Object { ($CommandNames -contains $_.Name) -and
5858
($_.ModuleName -ne $script:PSModuleProviderName) -and
59+
($_.ModuleName -ne 'PSModule') -and
5960
($_.ModuleName -ne $CurrentModuleInfo.Name) }
6061
if($AvailableCommands)
6162
{

0 commit comments

Comments
 (0)