I have a long program which does as such:
[xml]$data = get-content "c:\somedatafile.xml"$data.PRINTERS.PRINTER `| ? { $_.USERS.USER -eq "$env:username" } `| ForEach-Object{ # install some printer with $_}
I have also some COMPUTERS.COMPUTER to be compared with $env:computername
.
How can I install the printer if at least one of the COMPUTERS.COMPUTER -eq "$env:computername"
? Or how do I include OR and AND, and possibly () inside the ?
filter.
Where can the meaning of the ?
filter be found out (Google fails with monocarachter queries)?
Suggestions about code sanity are welcome.