File tree Expand file tree Collapse file tree 2 files changed +4
-5
lines changed Expand file tree Collapse file tree 2 files changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -2,6 +2,9 @@ using namespace System.Management.Automation.Language
2
2
using namespace System.Collections.Generic
3
3
4
4
# 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.
5
8
class AliasParameterVisitor : AstVisitor {
6
9
[string ]$Parameter = $null
7
10
[string ]$Command = $null
Original file line number Diff line number Diff line change @@ -168,13 +168,9 @@ Describe "GetCommandAlias" {
168
168
$Result | Should - Be ' Alias1' , ' Alias2' , ' Alias3'
169
169
}
170
170
171
- It " Ignores aliases that already have global scope" {
171
+ It " Does not fail when removing aliases that were ignored because of global scope" {
172
172
$Result = & $CommandInfo - Ast {
173
173
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
178
174
Remove-Alias - Name Alias1
179
175
}.Ast
180
176
You can’t perform that action at this time.
0 commit comments