Skip to content

Commit ee07827

Browse files
committed
Made alias removal safer for ordered hashtable
1 parent 3e2b75b commit ee07827

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

‎Source/Private/GetCommandAlias.ps1‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,10 @@ function GetCommandAlias {
107107
}
108108
end {
109109
# Return the aliases after filtering out those that was removed by `Remove-Alias`.
110-
$Result | Where-Object -FilterScript { $_.Keys -notin $RemovedAliases }
110+
$RemovedAliases | ForEach-Object -Process {
111+
$Result.Remove($_)
112+
}
113+
114+
$Result
111115
}
112116
}

0 commit comments

Comments
 (0)