Skip to content

Commit 30ab74b

Browse files
committed
Filter / Attributes check fix.
1 parent 4d771ce commit 30ab74b

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

ChangeLog.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11

22
# 4.0.0-preview3 (Planned)
33

4+
## Added / Modified
5+
6+
## Fixes
7+
- Get-SeElement -Filter attributes check fix.
8+
49

510

611
# 4.0.0-preview2 (Prerelease)

Public/Get-SeElement.ps1

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,10 +98,9 @@ function Get-SeElement {
9898
$AdditionalAttributes | ForEach-Object {
9999
if (!$MyAttributes.Contains($_)) { $MyAttributes.Add($_) }
100100
}
101-
$Attributes = [String[]]$MyAttributes
102101
}
103102

104-
if ($Attributes) {
103+
if ($MyAttributes.Count -gt 0) {
105104

106105
if ($GetAllAttributes) {
107106
Foreach ($Item in $Output) {
@@ -119,7 +118,7 @@ function Get-SeElement {
119118
foreach ($Item in $Output) {
120119
$AttArray = [System.Collections.Generic.Dictionary[String, String]]::new()
121120

122-
foreach ($att in $Attributes) {
121+
foreach ($att in $MyAttributes) {
123122
$attValue = $Item.GetAttribute($att)
124123
if ($attValue -ne "") {
125124
$AttArray.Add($att, $Item.GetAttribute($att))

0 commit comments

Comments
 (0)