Skip to content

Commit c470b2d

Browse files
committed
Clarifying comments
Also a minor change to a test to simplify and clarify it's purpose
1 parent ef27f62 commit c470b2d

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

Source/Classes/AliasVisitor.ps1

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@ using namespace System.Management.Automation.Language
22
using namespace System.Collections.Generic
33

44
# This is used only to parse the parameters to New|Set|Remove-Alias
5+
# NOTE: this is _part of_ the implementation of AliasVisitor, but ...
6+
# PowerShell can't handle nested classes so I left it outside,
7+
# but I kept it here in this file.
58
class AliasParameterVisitor : AstVisitor {
69
[string]$Parameter = $null
710
[string]$Command = $null

Tests/Private/GetCommandAlias.Tests.ps1

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -168,13 +168,9 @@ Describe "GetCommandAlias" {
168168
$Result | Should -Be 'Alias1', 'Alias2', 'Alias3'
169169
}
170170

171-
It "Ignores aliases that already have global scope" {
171+
It "Does not fail when removing aliases that were ignored because of global scope" {
172172
$Result = &$CommandInfo -Ast {
173173
Set-Alias -Name Alias1 -Scope Global -Value Write-Verbose
174-
Set-Alias -Scope Global -Value 'Write-Verbose' -Name 'Alias2'
175-
Set-Alias -Scope Global 'Alias3' 'Write-Verbose'
176-
Set-Alias -Value 'Write-Verbose' 'Alias4' -Scope Global
177-
Set-Alias 'Alias5' -Value 'Write-Verbose' -Scope Global
178174
Remove-Alias -Name Alias1
179175
}.Ast
180176

0 commit comments

Comments
 (0)