File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2,6 +2,9 @@ using namespace System.Management.Automation.Language
22using 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.
58class AliasParameterVisitor : AstVisitor {
69 [string ]$Parameter = $null
710 [string ]$Command = $null
Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments