I'm quite desperate for tips here. Here's my quandary:
First, I had an array of string, which I created this way (showing a subset of the numbers):
$a = @"
00013120747
00013051436
00013110491
00002100011
"@
$aa = $a.Split("`n")
Next, I generate a list of all users in Active Directory (using ActiveRoles) this way:
$all_u = Get-QADUser -DontUseDefaultIncludedProperties -IncludedProperties Name,LogonName,EmployeeID -SizeLimit 0
Now, why can't I match against an element of the $aa
array? For example, doing the following:
$all_u | where {$_.EmployeeID -match "00013110491"}
it works. But if I do the following:
$all_u | where {$_.EmployeeID -match $aa[2]}
it doesn't work.
So I did a simpler test:
$aa.GetType().Name
String[]
$aa[2].GetType().Name
String
$aa[2]
00013110491
$aa[2] -eq "00013110491"
False
What?? What's going on here???
I'm using PowerShell ISE, by the way.