I'm trying to write a simple powershell script.
Get-ADuser -Filter {GivenName -eq $GivenName $hateList} -SearchBase $Container -Properties displayName,telephoneNumber,department|ForEach-Object {"FullName`t: $($_.displayName)`r`nPhone`t`t: $($_.telephoneNumber)`r`nDepartment`t: $($_.department)`r`n"}
The error what I got: Get-ADUser : Error parsing query: 'GivenName -eq $GivenName $hateList' Error Message: 'syntax error' at position: '26'.
So the problem is that the variables aren't substituted with their values. What do I do wrong?