File tree Expand file tree Collapse file tree 1 file changed +1
-3
lines changed
src/PowerShellGet/private/functions Expand file tree Collapse file tree 1 file changed +1
-3
lines changed Original file line number Diff line number Diff line change @@ -46,15 +46,13 @@ function Validate-ModuleCommandAlreadyAvailable
46
46
if (-not $InstalledModuleInfo -or -not $InstalledModuleInfo.ModuleBase.StartsWith ($InstallLocation , [System.StringComparison ]::OrdinalIgnoreCase))
47
47
{
48
48
# Throw an error if there is a command with the same name from a different source.
49
- # Get-Command loads the module if a command is already available.
50
- # To avoid that, appending '*' at the end for each name then comparing the results.
51
49
$CommandNames = $CurrentModuleInfo.ExportedCommands.Values.Name
52
50
53
51
# construct a hash with all of the commands in this module.
54
52
$CommandNameHash = @ {}
55
53
$CommandNames | % { $CommandNameHash [$_ ] = 1 }
56
54
57
- $AvailableCommands = Microsoft.PowerShell.Core\Get-Command - Name * `
55
+ $AvailableCommands = Microsoft.PowerShell.Core\Get-Command `
58
56
- ErrorAction Ignore `
59
57
- WarningAction SilentlyContinue |
60
58
Microsoft.PowerShell.Core\Where-Object { ($CommandNameHash.ContainsKey ($_.Name )) -and
You can’t perform that action at this time.
0 commit comments