mirror of
https://github.com/PowerShell/PowerShell
synced 2026-06-08 12:12:50 +00:00
Add PSForEach and PSWhere as aliases for the PowerShell intrinsic methods Where and Foreach (#25511)
This commit is contained in:
@@ -200,6 +200,11 @@ Describe "Adapter Tests" -tags "CI" {
|
||||
|
||||
# TODO: dynamic method calls
|
||||
}
|
||||
|
||||
It "Can use PSForEach as an alias for the Foreach magic method" {
|
||||
$x = 5
|
||||
$x.PSForEach({$_}) | Should -Be 5
|
||||
}
|
||||
}
|
||||
|
||||
Context "Where Magic Method Adapter Tests" {
|
||||
@@ -240,6 +245,11 @@ Describe "Adapter Tests" -tags "CI" {
|
||||
} -PassThru -Force
|
||||
$x.Where(5) | Should -Be 10
|
||||
}
|
||||
|
||||
It "Can use PSWhere as an alias for the Where magic method" {
|
||||
$x = 5
|
||||
$x.PSWhere{$true} | Should -Be 5
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user